Write a program to read a list of exam scores given as integer percentages in the range 0 to 100. Display the total number of grades and the number of grades in each letter-grade category as follows: 90 to 100 is an A, 80 to 89 is a B, 70 to 79 is a C, 60 to 69 is a D, and 0 to 59 is an F. Use a negative score as a sentinel value to indicate the end of the input. (The negative value is used only to end the loop, so do not use it in the calculations.) For example, if the input is

98 87 86 85 85 78 73 72 72 72 70 66 63 50 ?1

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

This project requires both a sentinel controlled loop, multi-way selection, and running sums that need to be initialized to zero to guarantee correct results.


See the code in NumberOfGrades.java.

Computer Science & Information Technology

You might also like to view...

In order to create a namespace called student, you use

a. namespace student { //code goes here } b. { namespace student //code goes here } c. student namespace { //code goes here } d. { student namespace //code goes here }

Computer Science & Information Technology

Section 3 of the Image Processor will convert RGB files to CMYK files if you are saving them as JPEGs.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

When Access runs a query, it puts the results in a default order based on how the table is defined

Indicate whether the statement is true or false

Computer Science & Information Technology

The performance of the search algorithm on a binary search tree depends on how large the binary tree is.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology