Question: Write a program that computes the average test score over an unspecified number of tests as follows: ( 1 ) Ask the user to enter

Write a program that computes the average test score over an unspecified number of tests as follows: (1) Ask the user to enter numeric
grades; (2) as long as there are more grades, add them to the total; (3) use a counter variable to track the number of grades entered by the
user; (4) stop when the user enters a negative score; (5) output the average grade for the class.
Sample run of program:
Enter a numeric grade:
>78
Enter a numeric grade:
>89
Enter a numeric grade:
>77
Enter a numeric grade:
>90
Enter a numeric grade:
>97
Enter a numeric grade:
>92
Enter a numeric grade:
>-1
The average grade is 87.1667

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!