• OpenForInput(voteFile);
• if ( !voteFile )
• return 1;
• OpenForOutput(reportFile);
• if ( !reportFile )
• return 1;
•
• GetNames(name);
• ZeroVotes(votes);
•
• // Read and tally votes
• voteFile >> precinct >>
candidate;
• while (voteFile)
• {
•
votes[precinct-1][candidate-1]++;
• voteFile >> precinct >>
candidate;
• }