IT 210 Week 7-Checkpoint - Chapter 5 Programming Problems

IT 210 Week 7-Checkpoint - Chapter 5 Programming Problems -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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) Main Module Declare student as string Declare test1, test2, test3 as integer Call Input Module End Program End Main Module Input Module Open “GRADES” For Output As NewFile Write “Enter the student’s name and test score.” Write “Enter ZZZ for both when done.” Input student, test1 While Student <> “0” Write NewFile, Student, test1 Write “Enter the student’s name and test score.” Write “Enter ZZZ for both when done.” Input student, test2 While Student <> “0” Write NewFile, Student, test2 Write “Enter the student’s name and test score.” Write “Enter ZZZ for both when done.” Input student, test3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: While Student &lt;&gt; 0 Write NewFile, Student, test3 Write Enter the students name and test score. Write Enter ZZZ for both when done. Input Student, Score End While Close NewFile End Input Module 2. Display the contents of the file GRADES created in Problem 1. Each students 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 of output might be: R. Abrams 76 84 82 242 Declare sum as real Sum = test1 + test2 + test3 Open GRADES for Input As GradeFile While Not EOF(GradeFile) Read GradeFile, Name, test1, test2, test3 Write Name, , test1, test2, test3, sum End While Close GradeFile Output J.Smith 80 88 86 236 M. Smith 89 67 99 255...
View Full Document

Page1 / 2

IT 210 Week 7-Checkpoint - Chapter 5 Programming Problems -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online