Output timex totalsalesx totalcommx x x 1 endwhile

This preview shows page 44 - 48 out of 57 pages.

output TIME[x], totalSales[x], totalComm[x] x = x + 1 endwhile return 44
12. Design an application in which the number of days for each month in the year is stored in an array. (For example, January has 31 days, February has 28, and so on. Assume that the year is not a leap year.) Prompt a user to enter a birth month and day, and continue to prompt until the day entered is in range for the month. Compute the day’s numeric position in the year. (For example, February 2 is day 33.) Then, using parallel arrays, find and display the traditional Zodiac sign for the date. For example, the sign for February 2 is Aquarius.
Programming Logic and Design, 7e Solutions 6- “Virgo”, “Libra”, “Scorpio”, “Sagittarius”, “Capricorn” num SIGN_RANGE[SIGN_SIZE] = 0, 21, 51, 80, 111, 142, 173, 204, 234, 267, 297, 327, 357 getReady() while not eof detailLoop() endwhile finishUp() stop getReady() output “Enter a month and a day >> ” input month, day return detailLoop() while day < 1 OR day > DAYS[month-1] output “Day out of range, please reenter >> ” input day endwhile x = month – 2 while x >= 0 numPosition = numPosition + DAYS[x] x = x – 1 endwhile numPosition = numPosition + day x = SIGN_SIZE – 1 while numPosition < SIGN_RANGE[x] x = x – 1 endwhile output “The Zodiac sign for ”, month, “/”, day, “ is ”, SIGNS[x] output “Enter a month and a day >> ” input month, day return finishUp() output “End of program” return Find the Bugs 13. Your downloadable files for Chapter 6 include DEBUG06-01.txt, DEBUG06- 02.txt, and DEBUG06-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 : 45
Programming Logic and Design, 7e Solutions 6- Please see the DEBUG06-01.txt, DEBUG06-02.txt, and DEBUG06-03.txt solution files. Game Zone 14. Create the logic for a Magic 8 Ball game in which the user enters a question such as What does my future hold? The computer randomly selects one of eight possible vague answers, such as It remains to be seen. 46
Programming Logic and Design, 7e Solutions 6- 15. Create the logic for an application that contains an array of 10 multiple-choice

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture