Question: Write a c++ program that reads a number of grades from the user and prints the average. Your program must ask the user how many

Write a c++ program that reads a number of grades from the user and prints the average. Your program must ask the user how many grades(n) will be entered. Write a loop to read n number of grades. If a grade entry is a negative number then print an error message and break the loop. Print average grade.

sample i/o:

Enter how many grades: 5

Enter 5 grades one by one

3

4

7

-10

Invalid Entry, exiting the loop

You have entered 3 grades and the average is 4.66667

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!