Question: . Write a program to calculate a students grade based on three test scores. Prompt the user for three test scores, calculate the average, and

. Write a program to calculate a students grade based on three test scores. Prompt the user for three test scores, calculate the average, and then determine the grade using the algorithm below:

If the average score is 90% or more, the grade is A.

If the average score is 70% or more and less than 90%, check the third score. If the third score is more than 90%, the grade is A; otherwise the grade is B.

If the average score is 50% or more and less than 70%, check the average of the second and third scores. If the average of the two is greater than 70%, the grade is C; otherwise the grade is D.

If the average score is less than 50% then the grade is F.

Implement the algorithm using nested statements within a given range rather than merely using all simple if statements. Within the if structure, assign the grade to a character variable. Print the grade at the end of the program.

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!