TShift Ctri Alt CMP-126A Test-2 Assignments Name Hand in this paper after the te
ID: 3705398 • Letter: T
Question
TShift Ctri Alt CMP-126A Test-2 Assignments Name Hand in this paper after the test Program 1 Write a program called TestSummary that uses Scanner to read input from the user. The user will input grades on tests. The program will calculate the minimum grade, maximum grade, and the average grade and print it out to the user. Here are some details: You don't know ahead of time how many grades there will be. This means you need to use a while loop, not a for loop. When the user inputs a grade of"-l" (or any negative grade), you should break out of the while loop. 1. 2. Remember to prompt the user for the next grade in the while loop. You should print out each grade in the while loop. You should print the minimum grade, maximum grade, and average grade after the while loop.Explanation / Answer
Output:
Enter the number (-1 to quit) : 10
Enter the number (-1 to quit) : 20
Enter the number (-1 to quit) : 30
Enter the number (-1 to quit) : -1
Minimum number : 10
Maximum number : 30
Average of numbers : 20.0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.