Chapter 5 Programming Problems

Chapter 5 Programming Problems - Write Enter ZZZ for...

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

View Full Document Right Arrow Icon
Chapter 5 Programming Problems Problem 1 Declare Student Name 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 Write “Enter students name and test scores separated by commas.” Write “Enter ZZZ for students name when finished.” Input StudentName, Test1, Test2, Test3 While StudentName <> “ZZZ” Write TestScores, StudentName, Test1, Test2, Test3 Write “Enter students name and test scores separated by commas.” Write “Enter ZZZ for students name when finished.” Input StudentName, Test1, Test2, Test3 End While Close TestScores 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 Write “Enter students name and test scores separated by commas.”
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: Write Enter ZZZ for students name when finished. Input John Doe, 98, 90, 75 While StudentName &lt;&gt; ZZZ Write Test Scores, John Doe, 98, 90, 75 Write Enter students name and test scores separated by commas. Write Enter ZZZ for students name when finished. Input ZZZ, End While Close TestScores Problem two Declare Sum as integer Open GRADES For Input as Test Scores While Not EOF (Test Scores) Read TestScores, StudentName, Test1, Test2, Test3 Add Test1 + Test2 + Test3 = Sum Write StudentName, Test1, Test2, Test3, Sum End While Close TestScores Declare Sum as integer Open GRADES For Input as TestScores While Not EOF (TestScores) Read Test Scores, John Doe 98, 90, 75 Add 98+90+75=263 Write John Doe: 98, 90, 75, 263 End While Close TestScores Expected Output: John Doe: 263...
View Full Document

Page1 / 2

Chapter 5 Programming Problems - Write Enter ZZZ for...

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