Analysis – First I need to declare A, B, C, D, F and GPA as integers.
A = 4, B = 3, C = 2, D = 1, F = 0.
Each of these numbers will be floated
The program will ask for the name of the user
User Name: Stephen
The program will then ask for the grades.
Grades Entered: A,A,D
The letters corresponding to the integers will be summed ex. A+A+D = 4+4+1 = 9
The program will then divide the sum of the integers by the amount entered.
9/3 = 3.0 = GPA
The program will print the students name and their GPA
Name: Stephen GPA = 3.0
Test Plan -
Test Case #
Input
Expected Output
1
Steve: A,A,D
James: A,A,D,B
Chris: D,B,D,C
Kelly: F,A,C,C,D
Rick: D,C,C
Crystal: C,A,D
David: D,A,A,C,B
Kelsey: B,B,A,C,C
Laura: A,A,F
Marissa: D,D,A,B
GPA for Steve: 3.0
GPA for James: 3.0
GPA for Chris 1.75
GPA for Kelly: 2.25
GPA for Rick: 1.25
GPA for Crystal:1.75
GPA for David: 3.0
GPA for Kelsey: 2.8
GPA for Laura: 2.67
GPA for Marissa: 2.25
Pseudocode-
//Purpose: This program will allow students to input their name and grades to determine a GPA value
//Developer: Joe Metz
//GPA Calculator
//Variable Definition
Input=STUDENT_NAME, GRADES
Floats=GPA
Integers= NUM_OF_CLASSES, GRADE_POINTS,A,B,C,D,F
//Declare Integer Values
GRADE_POINTS= A=4, B=3, C=2, D=1, F=0
//Initiate Student Loop
For (students=0; students<10; students++)
Print “Enter Student Name”
User Input Student Name
//Reset sum to 0.0
Sum=0.0
Print “Input Grades”
User Input Grades
//Calculate Grade_Points
SUM=SUM_OF_GRADEPOINTS
//Calculate GPA
GPA=SUM/NUM_OF_CLASSES
Print “The GPA for “STUDENT_NAME” is “GPA”
Flowchart-