Question: in the C language Write a program that assigns test score grades. The program's input should be a series of test scores of type int

in the C language Write a program that assigns test score grades. The program's input should be a series of test scores of type int. Have the program read each score and print either the corresponding grade or an appropriate error message. The program is to continue until end-of-file. If invalid character data is entered, you will need to flush the invalid characters so that test scores can continue to be entered until end-of-file.

Assume the following grading scale:

9 - 10 A

8 B

7 C

6 D

0 - 5 F

Use a switch statement to assign or print the appropriate grade.

Run your program using the following input:

1. All of the values between 0 and 10, inclusive

2. A negative value

3. A value greater than 10

4. A character value

Run the program with a valid value after all of these error cases to verify that the bad data was flushed correctly.

USE the correct use of local variables, local prototypes, and parameter passing

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!