Chapman 1

Waylon Chapman HW3

CMIS 102

Larry Voss

2 October 2018

Overall good submission; Get command is not a part of this class. Not sure why you keep using it? Each assignment statement needs to be preceded with Set. This is not a C class; syntax errors below

Program Description

Need to design the program that would help calculate the GPA for class. Program would let user enter any number of students as they may wish and for each student it should let user enter grades for any number of the courses.

Analysis good IPO chart

Input / Processing / Output
studentName
grade / Print “Enter Student Name (Enter X to stop)”
Get studentName
While studentName!=”X”
totalScore = 0
totalCourse = 0
Print “Enter Grade(A,B,C,D, F or X to stop): “
Get grade
While grade!=”X”
IF grade=”A”
totalScore=totalScore+4
totalCourse = totalCourse+1
Else IF grade=”B”
totalScore=totalScore+3
totalCourse = totalCourse+1
Else IF grade=”C”
totalScore=totalScore+2
totalCourse = totalCourse+1
Else IF grade=”D”
totalScore=totalScore+1
totalCourse = totalCourse+1
Else IF grade=”F”
totalScore=totalScore+0
totalCourse = totalCourse+1
End IF
Print “Enter Grade(A,B,C,D, F or X to stop): “
Get grade
End While
gpa = totalScore/totalCourse
Print “GPA for “, studentName, “ is : “, gpa
Print “Enter Student Name (Enter X to stop)”
Get studentName
End While / gpa

Data Dictionary good

Sr. No. / Variable name / Data Type / Scope / Description
1. / studentName / character / local / Student name entered by user
2. / grade / character / local / Letter grade entered by the user
3. / totalScore / integer / local / Total of all scores of student based on his grades
4. / totalCourse / integer / local / Total number of courses entered for a student
5. / gpa / real / local / Calculated GPA for a student

Test Case good

Input / Exprected Output
Sally A D B C / GPA: 2.5
John A A A B B / GPA: 3.6
Jason A A A A B / GPA: 3.8
Bob B B / GPA: 3
Bill A / GPA: 4
Suz B / GPA 3
Mark D / GPA 1
Mary A A B B C C F / GPA 3
Rod C C C D / GPA 1.75
Pat B B A A C C D D / GPA 2.5

Flowchart

Pseudocode

Main Module

Declare totalScore As Integer =0

Declare totalScore = 0 As Integer

Declare totalCourse As Integer = 0 same asa bove

Declare gpa As Real = 0 use same syntax as above

Declare studentName As String

Declare grade As String Character

Print “Enter Student Name (Enter X to stop)”

Get studentName Get is not a apart of this language

While studentName!=”X”

Set totalScore = 0

Set totalCourse = 0

Print “Enter Grade(A,B,C,D, F or X to stop): “

Get Input grade

While grade!=”X” ‘X’ good logic

IF If grade==”A” Then

Set totalScore=totalScore+4

Set totalCourse = totalCourse+1

Else IfF grade==”B” Then

Set totalScore=totalScore+3

Set totalCourse = totalCourse+1

Else IF grade=”C” Then

Set totalScore=totalScore+2

Set totalCourse = totalCourse+1

Else IF grade=”D” Then

Set totalScore=totalScore+1

Set totalCourse = totalCourse+1

Else IF grade=”F” Then

Set totalScore=totalScore+0

totalCourse = totalCourse+1

End IF

Print “Enter Grade(A,B,C,D, F or X to stop): “

Get grade

End While

Set gpa = totalScore/totalCourse

Print “GPA for “, studentName, “ is : “, gpa

Print “Enter Student Name (Enter X to stop)”

Get studentName

End While

End Main