Presentation is loading. Please wait.

Presentation is loading. Please wait.

Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04.

Similar presentations


Presentation on theme: "Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04."— Presentation transcript:

1 Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04

2 The problem Write a program to read a list of exam scores (integer percentages in the range 0 to 100) and to output the total number of grades and the number of grades in each letter-grade category (90 to 100 = A, 80 to 89 = B, 70 to 79 = C, 60 to 69 = D, and 0 to 59 = F). The end of the input is indicated by a negative score as a sentinel value. (The negative value isused only to end the loop, so do not use it in the calculations). (Example on next slide)

3 Problem (continued) For example, if the input is 98 87 86 85 78 73 72 70 66 63 50 the output would be: Total number of grades = 14 Number of A’s = 1 Number of B’s = 4 Number of C’s = 6 Number of D’s = 2 Number of F’s = 1


Download ppt "Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04."

Similar presentations


Ads by Google