Title: Computing Grades
Topics covered:
Data types: integer, floating point, character
Arithmetic Operations
Assignment Operator
Relational Operators
Selection Structures: if and if/else statements
Nested if/else statements.
Purpose: Compute a student's numeric and letter grade.
Description: After displaying a brief description of the
program, the computer prompts the user to input three homework grades,
a midterm grade and a final exam grade. The homework grade is
computed by taking the average of the three homework grades. The test
grade is computed by counting the midterm 40% and the final 60%. The
student's final numeric grade is computed by counting the homework and
test grades equally if the homework grade is higher; otherwise the
homework grade is counted 45% and the test grade 55%. The numeric
grade should be rounded to the nearest integer. Also compute a
letter grade of E, S or U from the numeric grade as follows: 80-100 is
an E, 55-79 is an S and below 55 is a U. Display both numeric grade
and letter grade. Also, if the student's grade is an E, display the
message "Outstanding job!"; if its an S, display the message
"Satisfactory work. Try to improve."; if its a U, display the message "Try harder."
Sample Output:
This program inputs three homework grades, a midterm grade and a final
exam grade. It computes and displays a numeric grade and
letter grade of E, S, or U.
Enter the three homework grades: 73 76 79
Enter the midterm grade: 80
Enter the final exam grade: 70
Numeric grade is 75.
Letter grade is S.
Satisfactory work. Try to improve.
Submission: Use the top-down design strategy discussed in class to design your program. As usual submit an electronic copy of your source program to your TA by the due date.