# Output total items ordered in other zip codes

• Homework Help
• 40
• 97% (62) 60 out of 62 people found this document helpful

This preview shows page 33 - 38 out of 40 pages.

output “Total items ordered in other zip codes = ”, numItemsInOtherZipsavgCustAge = totalCustAge / countOfOrdersoutput “The average customer age is: ”, avgCustAgeoutput numItemsUnder30, “ items were ordered by customers under 30”output numItems30AndOlder,“ items were ordered by customers 30 and older”endifoutput “End of program”returnFlowchart:The flowchart’s structure will be very similar to that given for previous exercises.Find the Bugs15. Your downloadable files for Chapter 5 include DEBUG05-01.txt, DEBUG05-02.txt, and DEBUG05-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with two slashes (//). Following the comments, each file contains pseudocode that has one or more bugs you must find and correct.Answer:Please see the DEBUG05-01.txt, DEBUG05-02.txt, and DEBUG05-03.txt solution files.Game Zone16. In Chapter 2, you learned that in many programming languages you can generate a random number between 1 and a limiting value named LIMITby using a statement similar to randomNumber = random(LIMIT). In Chapter 4, you created the logic for a guessing game in which the application generates a random number and the player tries to guess it. Now, create the guessing game itself. After each guess, display a message indicating whether the player’s guess was correct, too high, or too low. When the player eventually guesses the correct number, display a count of the number of guesses that were required.
Programming Logic and Design, 7eSolutions 5-34Pseudocode:startDeclarationsnum myRandomNumbernum guessnum countnum LIMITstring PROMPT = “Enter a number between 1 and ”string CORRECT = “You guessed correctly!”string HIGH = “You guessed too high!”string LOW = “You guessed too low!”housekeeping()while guess not equal to myRandomNumberdetailLoop()endwhilefinishUp()stophousekeeping()myRandomNumber = random(LIMIT)output PROMPT, LIMIT input guess
17. Create the logic for a game that simulates rolling two dice by generating two numbersbetween 1 and 6 inclusive. The player chooses a number between 2 and 12 (the
Programming Logic and Design, 7eSolutions 5-36Pseudocode:startDeclarationsnum dice1num dice2