GPA program 1) Define and Analyze: write a program to compute a GPA Inputs: credits and grades for every course, # of courses Outputs: the computed GPA How: add all the credits (credittotal) add all the credits multiplied by grade points (pointtotal) gpa is pointtotal / credittotal Grade Point System: 4 = A, 3 = B, 2 = C, 1 = D, 0 = F, + is +.3 (except A+), - is -.3 (except no D- at JHU) Example: A 4, B+ 3, c 4, a- 3, d 1 credittotal is 4 + 3 + 4 + 3 + 1 = 15 pointtotal is 4*4 + 3.3*3 + 2*4 + 3.7*3 + 1*1 = 46 GPA 46 / 15 = 3.06666666667 Sample Run: Welcome to GPA program! Enter grades and credits for each course, STOP to end: A 4 B+ 3 c 4 a- 3 d 1 STOP GPA is 3.06667 2) Write Pseudocode Main Action - print welcome - prompt for input - initialize creditTotal to 0 - initialize pointTotal to 0 - repeat - read grade - if grade is not STOP - read credits - check validity of data - add credits to creditTotal - convert letter grade to points - add credits * points to pointTotal until grade is STOP - set gpa to pointTotal / creditTotal - display "GPA is", gpa - if gpa >= 3.5 - display "Dean's List" - if gpa < 2.0 - display "Academic Probation" Convert letter grade to points: - if first letter is A, - set points to 4 else if first letter is B - set points to 3 else if first letter is C - set points to 2 else if first letter is D - set points to 1 else - set points to 0 - if there is a second character - if second is + and first is B, C, D - add .3 to points else if second is - and first is A, B, C - subtract .3 from points - return points