|
|
|
|
|
|
|
Open file voteFile for input
IF voteFile could not be opened
Terminate program
Open file reportFile for output
IF reportFile could not be opened
Terminate program
Get candidate names
Set votes array to zero
Read precinct, candidate from voteFile
WHILE NOT EOF on voteFile
Increment votes[precinct-1][candidate-1] by 1
Read precinct, candidate from voteFile
Write table of votes to reportFile
Write totals per candidate to reportFile
Write totals per precinct to reportFile |
|
|
|
|
|
|
|
|
|
Open For Input (Inout: someFile) Level 1 |
|
|
|
|
|
|
|
|
|
We can reuse the Open For Input module from the
Exam program in Chapter 12. |
|
|
|
|
|
|
|