CS 355 - Systems Programming Lab 1 - Conditions
Objective: write a program that converts a numeric grade into a letter grade.
- Write a C program converter that prompts the user to enter an integer:
Please enter a numeric grade:
converter interprets the entered value as a numeric grade on a 0-100 point scale and converts it into a letter grade as follows:
- [100..90] is an A;
- (90..80] is a B;
- (80..70] is a C;
- (70..60] is a D;
- (60..0] is an F;
- all other values are invalid.
converter will print out valid results that should look like this:
Please enter an numeric grade: 75
Your grade is a C.
converter will produce an error message in response to invalid entries:
Please enter an numeric grade: 190
You entered an invalid value.
Please enter an numeric grade: abc
Your input could not be interpreted as an integer value.
Use the following input as test cases to verify the correctness of your code: 95, 83, 77, 64, 49, 195, -12, abc.
- A single C source code file with your work.
- A screenshot (in PNG or JPG format) showing your program executing each of the above test cases on a Linux terminal.