Output enter the age or quit to quit input age return

This preview shows page 25 - 29 out of 414 pages.

output “Enter the age or ”, QUIT, “ to quit” input age return finishUp() output “End of program” return Flowchart: Pseudocode: start Declarations num speed num errors num x num y num speedIndex num errorIndex num SPEED_GROUPS = 4 num MAX_ERRORS = 7 num SPEED_RANGES[SPEED_GROUPS] = 0, 20, 40, 70 string SPEED_LABELS[SPEED_GROUPS] = “0-19”, “20-39”, “40-69”, “70 or more” num table[SPEED_GROUPS][MAX_ERRORS] = 0 num QUIT = 999 getReady() while speed <> QUIT fillTable() endwhile displayTable() stop getReady() output “Enter the speed or ”, QUIT, “ to quit” input speed return 11. Executive Training School offers typing classes. Each final exam evaluates a student’s typin Answer: A sample solution follows
fillTable() output “Enter the number of errors”
Over $10.00 $6.00 through $9.99 $3.00 through $5.99 Under $3.00 12. HappyTunes is an application for downloading music files. Each time a file is purchased, a t
Pseudocode:
start Declarations string genre num price num genreIndex num priceIndex num x num y num PRICE_GROUPS = 4 num TOTAL_GENRES = 6 string GENRES[TOTAL_GENRES] = “Classical”, “Easy listening”, “Jazz”, “Pop”, “Rock”, “Other” num PRICE_RANGES[PRICE_GROUPS] = 10, 6, 3, 0 num table[TOTAL_GENRES][PRICE_GROUPS] = 0 string QUIT = “ZZZ” getReady() while genre <> QUIT fillTable() endwhile displayTable() stop getReady() output “Enter the genre or ”, QUIT, “ to quit” input genre return fillTable() output “Enter the price paid” input price x = 0 while price < PRICE_RANGES[x] x = x + 1 endwhile priceIndex = x x = 0 while x < TOTAL_GENRES AND genre <> GENRES[x] x = x + 1 endwhile genreIndex = x table[genreIndex][priceIndex] = tabl endwhile output “Enter the genre or ”, QUIT, “ to quit” input genre return
displayTable() x = 0 y = 0 // the following should be displayed on one line Over $10.00 $6.00 through $9.99 $3.00 through $5.99 under $3.00 while x < TOTAL_SUBJECTS output GENRES[x] y = 0 while y < PRICE_GROUPS output table[x][y] y = y + 1 endwhile x = x + 1 endwhile return Performing Maintenance

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture