Question: *Write a program that prompts the user to enter the total number of students first. *Then ask the user to input each students grade and

*Write a program that prompts the user to enter the total number of students first. *Then ask the user to input each students grade and use loop statements to read in each grade. Check input grade to make sure 0<=grade<=100, if the user input any other number, print out warning message and ask the user to input a new grade. *Display the highest score, the lowest score, and the average.

Here is the sample run:

Please input the total number of students: 10

Please input the students grade: 56 23 89 45 96 -45

Grade must between 0 and 100.

Please input another score: 45 12 85 74 65

The highest grade is: 96

The lowest grade is: 12

The average grade is: 59

Note: You do not need to use array to save each input score for this lab. A Single loop to read in each grade, compare with the current highest grade, lowest grade, and calculate the running sum at the same time.

(Java)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!