Question: You are tasked to write a calculator for the average score of a class. First, your program will ask the user to input 4 grades

You are tasked to write a calculator for the average score of a class. First, your program will ask the user to input 4 grades one by one, which are expected to be values 0-100. Then the simple average (mean) will be calculated and printed to the screen. Bonus points if you write code to validate the grades are entered correctly. If a bad grade, say -5, is entered, the program should print a message letting the user know there was a bad input and not proceed with calculating an average.
(1) Write this program using a for loop. (5 points)
(2) Write this program using a while loop. (5 points)

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 Programming Questions!