# Checkpoint Week 7 Chapter 5

Only available on StudyMode
• Topic: Andrew Martin, Ring, Addition
• Pages : 3 (334 words )
• Published : October 14, 2011

Text Preview
Analysis:

Process:

2. Display StudentName
3. Display TestScores
5. Display Sum

Input:

StudentName As String
Test1 As Integer
Test2 As Integer
Test3 As Integer
Sum As Integer

Output:

Display all three TestScores and the Sum

Problem 1:
Input names of students from the user, terminated by ZZZ, and create a data file GRADES with records of the form: student(string), test1(integer), test2(integer), test3(integer). In this file, all test scores should b e set equal to 0.

Main Module

Declare StudentName As String
Declare Test1, Test2, Test3 as Integers

End Main Module

Declare StudentName As String
Declare Test1 As Integer
Declare Test2 As Integer
Declare Test3 As Integer
Open “GRADES” For Output As TestScores
Set Test1, Test2, Test3 = 0
Display “Enter student’s name and test scores separated by a comma.”
Display “Enter ZZZ for student’s name when you are finished.”
Display “ To move on to the next student entry hit the enter key.”
Input StudentName, Test1, Test2, Test3

While StudentName <> “ZZZ”
Display TestScores, StudentName, Test1, Test2, Test3
Display “Enter student’s name and test scores separated by a”
Display “comma”
Display “Enter ZZZ when you are finished.”
Input “ZZZ”
End While
Close TestScores

Problem 2:
Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example a line output might be:

R. Abrams768482242

Main Module

Declare StudentName As String
Declare Test1, Test2, Test3 As Integers
Declare Sum As Integer
Call ComputeSum Module

End Main Module

ComputeSum Module
Sum...