GPA PROGRAM 1) Define & analyze problem standard point system: A = 4 B = 3 C = 2 D = 1 F = 0 + means add .3 (except not for A, F) - means subtract .3 (don't use on D, F) S, U = ignored by GPA computation take course grade, convert it to point value, multiply by credits add all those together (total points) add all credits together (total credits) gpa is total points / total credits SAMPLE RUN --------------------------------- Welcome to the GPA Program (assume a standard point system) How many courses? 4 for each course enter the grade & credits separated by space for course 1: A 3 (points = 12) for course 2: B 1 (points = 3) for course 3: B+ 4.5 (points = 14.85) for course 4: D 3 (points = 3) (total points = 32.85) (total credits = 11.5) GPA is 2.86 Not on AcPro --------------------------------------------- 2) Design the solution Pseudocode for algorithm display welcome message get # of courses repeat # of courses times ask for grade & credits convert grade to points multiply points by credits add to total points add credits to total credits gpa is total points divided by total credits display gpa if (gpa < 2) display "on AcPro" otherwise display "not on AcPro" if (gpa >= 3.5) display "Dean's List!!! Yay!!" display welcome message prompt for # of courses read numCourses initialize totalCredits to 0 initialize totalPoints to 0 initialize count to 1 while count <= numCourses ask for grade & credits read grade read credits convert grade to points*** points gets points * credits totalPoints gets totalPoints + points totalCredits gets totalCredits + credits count gets count + 1 gpa gets totalPoints / totalCredits if (gpa < 2) display "on AcPro" otherwise display "not on AcPro" if (gpa >= 3.5) display "Dean's List!!! Yay!!" ***convert grade to points get first letter of grade if (first is A), points gets 4 if (first is B), points gets 3 if (first is C), points gets 2 if (first is D), points gets 1 if (first is F), points gets 0 if there is a second character if second is '+' and first not an A or F add .3 to points if second is '-' and first not an D or F subtract .3 from points return points as result