Week 7 Checkpoint

Submitted by: Submitted by

Views: 412

Words: 253

Pages: 2

Category: Science and Technology

Date Submitted: 03/30/2013 01:36 PM

Report This Essay

IT/210 Week 7 CheckPoint: Ch. 8 Programming Problems

1. Input names of students from the user, terminated by “ZZZ”, 0, 0, 0, and create a data file Grades with records of the following form:

Student (String), Test1 (Integer), Test2 (Integer), Test3 (Integer)

2. Display the contents of the file grades created in Part a. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student.

Analysis:

Process:

1. Open “Student Grades”

2. Display “Enter Student’s Name”

3. Display “Enter Test Scores”

4. Add Test Scores

5. Display Sum

Input:

Student as String

Test1 as Integer

Test2 as Integer

Test3 as Integer

Sum as rea;

Output:

Display Student’s name and their three Test Scores and the Sum

Main Module

Declare Student_Name as String

Declare Test1 as Integer

Declare Test2 as Integer

Declare Test3 as Integer

Call Input Module

Call Student_Average Module

Quit Program

End Main Module

Input Module

Open “Grades” for Output as NewFile

Set Test1, Test2, Test3, = 0

Write, “Enter Student’s Name.”

Write, “Enter Student’s Test Score”

Write, “Enter ZZZ for both when done.”

Input Student_Name,

Input Test1

Input Test2

Input Test3

Input “ZZZ”

End Input Module

Student_Average Module

Declare Sum as Integer

Input Student, Test1, Test2, Test3

Sum = Test1 + Test2 + Test3

Write, “Student” test scores are, “Test1”, “Test2”, “Test3”, and the “Sum” is the sum

Close NewFile

End Student_Average Module

Output:

C. Braxton 92, 88, 80, 260

D. Conners 79, 85, 96, 188

J. Wallace 98, 81, 94, 273