Question

In: Computer Science

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes

What does this do? Desk Checking #3:  Explain the intent of this pseudocode.  Be as specific as possible.  
List the data you use for example data.

Use this textbox to explain the pseudocode/ code intent. Include any test data used:

start

         Declarations

                                    num idNumber

                                    num itemsSold

                                    num itemsValue

                                    num ITEM_MIN = 200

                                    num VALUE_MIN = 1000

                                    string MSG = “High Performer!”

                  housekeeping()

                  detail()

                  finish()

         stop

         housekeeping()

                  output “Salesperson program”

                  input idNumber, itemsSold, itemsValue

         return

         detail()

                  if itemsSold > ITEM_MIN AND itemsValue > VALUE_MIN then

                                    output MSG

return

finish()

         output “End of program”

return

Solutions

Expert Solution

So to get this psuedo code understanable better, i will give you an example and go through the all the steps to make it easy . I have used 2 example below with values please go thourgh all

Let me explain the methods first and declarations:

Declarations

                                    num idNumber //declaring num type variable with name idNumber

                                    num itemsSold //declaring num type variable with name itemsSold

                                    num itemsValue //declaring num type variable with name itemsValue

                                    num ITEM_MIN = 200 //declaring num type variable with name ITEM_MIN and initializing with value 200

                                    num VALUE_MIN = 1000 //declaring num type variable with name VALUE_MIN and initializing with value 1000

                                    string MSG = “High Performer!”  //declaring string type variable with name MSG and initializing with value High Performer!

housekeeping() :

  • This program will output the string as Salesperson program and reads the input from the user for the idNumber, itemsSold, itemsValue

detail() : This method will check for the following case that,

  • itemsSold is strictly greater than ITEM_MIN variable (which was initialized with the value 200 in declarations) and itemsValue is strictly greatte than VALUE_MIN (which was initialized with the value 1000 in declarations).
  • if the user input values (itemsSold , itemsValue ) satifies the above mentioned conditions then the detail() will output the string MSG which contains High Performer! and will return.
  • If any condition fails , then it will just return without printing anything

finish()

  • This method will output the string “End of program” and returns and goes back to called function and execute next action . i.e stop and program ends.

Example:

After declarations and initializing the variables in the Declarations window, the 1st method that called is housekeeping()

This method prints output Salesperson program and reads the values for below variables

Lets take here that user input the following values :

  • idNumber = 1,
  • ItemsSold = 500 ,
  • itemsValue = 5000

Then detail() method will be called and process happens as below

  • it checks ItemsSold value i.e 500 > 200 (which is ITEM_MIN) and also itemsValue i.e 5000 > 1000 (Which is VALUE_MIN)
  • so both the conditions are true i.e (500 > 200 ) and (5000 > 1000) , it will output High Performer!
  • (thats there in MSG)

Then it returns and execute  finish() Which will output End of program and returns

Then program will stop

Example 2:

After declarations and initializing the variables in the Declarations window, the 1st method that called is housekeeping()

This method prints output Salesperson program and reads the values for below variables

Lets take here that user input the following values :

  • idNumber = 1,
  • ItemsSold = 20 ,
  • itemsValue = 5000

Then detail() method will be called and process happens as below

  • it checks ItemsSold value i.e 20 > 200 (which is ITEM_MIN) and also itemsValue i.e 5000 > 1000 (Which is VALUE_MIN)
  • so the condition 1 is false i.e (20 > 200 ) and condition (5000 > 1000) true, so it will not output any string . Since and will check both conditions are true or not

Then it returns and execute  finish() Which will output End of program and returns

Then program will stop


Related Solutions

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...
- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes. Use this textbox to explain the pseudocode/ code intent. Include any test data used: What does this do? Desk Checking #4:  Explain the intent of this code.  Be as specific as possible.   List the data you use for example...
- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...
- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes. What does this do? Desk Checking #2:  Explain the intent of this pseudocode.  Be as specific as possible. List the data you use as the example data. Use this textbox to explain the pseudocode/ code intent. Include any test...
- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...
- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes. What does this do? Desk Checking #1:  Explain the intent of this pseudocode. List the data you use as the example data. start                   Declarations          num balance Use this textbox to explain the pseudocode/ code intent. Include any test...
Show your results all planning tools (algorithm, IPO chart, desk checking, pseudocode, flowchart) for an application...
Show your results all planning tools (algorithm, IPO chart, desk checking, pseudocode, flowchart) for an application that allows a user to enter the price of an item and computes 6.25 percent sales tax on the item.
Show your results using all planning tools (algorithm, IPO chart, desk checking, pseudocode, flowchart) for an...
Show your results using all planning tools (algorithm, IPO chart, desk checking, pseudocode, flowchart) for an application that allows a user to enter the number of text messages he or she sent last month and then displays the bill. Messages cost 25 cents each, and 8 percent tax is charged on the total.
Write program logic or pseudocode to create 3 small programs that do the following: The first...
Write program logic or pseudocode to create 3 small programs that do the following: The first should compute the sum of 2 given integers. The second should multiply the 2 integers. The third should triple the sum of the 2 integers.
4. PROPOSED SOLUTION (PSEUDOCODE) • Start. • Initialize the clear cycle=1 and part[2],generated=0. • Declare the...
4. PROPOSED SOLUTION (PSEUDOCODE) • Start. • Initialize the clear cycle=1 and part[2],generated=0. • Declare the parts of the car as ‘engine’, ‘chassis’, ‘ss’. • Initialize the semaphore sem t ready. • Assign the ids from 0 to 3. • Declare the function void * gen branch(void*arg) which generates the assembly branch. • In the above function declare i,j,k=0 . • Repeat the step 7 until while(1). • Declare sleep(1) so that when the loop runs the next time it...
- Part 1 – 4 Debugging Exercises – there are things wrong – either logic or...
- Part 1 – 4 Debugging Exercises – there are things wrong – either logic or syntax errors.  Correct the pseudocode and one Java program. Add the corrected code in BOLD and change the corrected color to RED.   Debugging 2:  Add the missing code in bold and red. start                   Declarations                            num number                             housekeeping()                   while number >= 15                            detailLoop()                   endwhile                             finish()     stop housekeeping()          number = 1 return detailLoop()          output number          num = number + 1 return finishUp()          output “End of program”...
In the same file, complete the following exercises in the author’s pseudocode as presented in the...
In the same file, complete the following exercises in the author’s pseudocode as presented in the text book and material on Blackboard in this chapter, and following all requirements for good program design that were shown in Chapter 2 and all examples since then. At the Summer Olympic Games every four years, for historical reasons, athletes represent National Olympic Committees (NOCs) rather than strictly countries. For the sake of convenience in our program, let us refer to them simply as...
what is inspection, walkthrough and Desk checking testing my course is analysis and design and it's...
what is inspection, walkthrough and Desk checking testing my course is analysis and design and it's not shows in the subject so i choose operation management just to complete the process !!!
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT