SemesterGPA - Algorithm to calculate the semester GPA Sample done in Ms Eddy's class on Tuesday Nov 6 Simplified from class example since all classes

# SemesterGPA - Algorithm to calculate the semester GPA...

This preview shows page 1 - 2 out of 2 pages.

Algorithm to calculate the semester GPA: Sample done in Ms. Eddy's class on Tuesday, Nov. 6. Simplified from class example: since all classes are 3 credit hours, assumes grade points range from 0.0-4.0 (rather than 0.0-12.0). 1. Write the description Algorithm SemesterGPA . Given three classes ( class1, class2, class3 ) and the grade points ( points1, point2, points3 ) for each in the current semester, calculate the semester GPA ( gpa ). The class variables are Strings and the grade points are real numbers. We assume all classes have the same credit hours. 2. Write the high-level steps (these the descriptions that go into the [ ] brackets in the algorithm) a. [ Input class names and points] b. [Calculate the GPA for this semester] c. [Print the GPA and any other thing you wish to print] 3. Fill in the details for each step (using ALCSE language) 1. [Get the class names and points] Read ( class1, points1, class2, points2, class3, points3 ) 2. [Calculate the GPA for this semester] gpa = (points1 + points2 + points3) / 3 3. [Print the GPA and any other thing you wish to print ] Write ( “My semester GPA is:“ ) Write ( “First class is “, class1, “ points = “, points1 )  #### You've reached the end of your free preview.

• • •  