Programming Project One Grade Point Average
Out: Tuesday 9/23/97 |
In order to produce the GPA, several calculations are needed. For each course, the number of credits, multiplied by the grade point earned in that class, results in a value known as quality points. To calculate the GPA, the total number of quality points for the semester is divided by the total number of credits taken that semester, exclusive of credits for courses taken with the Pass/Fail grading method. Your program should NOT handle Pass/Fail courses at all. The only acceptable grade points are in the range of 0 through 4, where 4 is an A, 3 a B, 2 a C, 1 a D, and 0 an F. For this assignment, both the grade points and the number of credits for each course, should be entered as integers and gotten from the user with the GetInteger() function.
To begin you should print a message to the user explaining what the program does. Then you should ask the user to enter the semester. After these initial steps, you should begin asking the user to enter the number of credits and grade points for each course, one course at a time. The user should enter a -1 as the number of credits to end the input phase. So -1 is the sentinel value for this exercise. At this point a report should be generated that shows the total number of credits taken, the total quality points earned, and the GPA for the semester.
Your program must generate all of the same information as shown in the sample run. You do not need to match the output exactly, however the GPA should be shown to three decimal places. You may also use the data shown here to test your program for accuracy.
To submit the file you should use the command:
submit cs201 proj1 proj1.c
You can check your submission by using the command:
submitls cs201 proj1