Chapter 5 Programming Problems

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

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

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.”

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

View Full Document
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 <> “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

## This note was uploaded on 08/12/2011 for the course IT 210 taught by Professor Josephpillera during the Spring '10 term at University of Phoenix.

### 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
Ask a homework question - tutors are online