Engr 101 - Exam 1_key F12

Txt contents of votestxt contents of votestxt 2 1 2 2

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: increment the number of votes for other candidates by 1 since only candidates 1 and 2 have a real chance of winning the election After reading in numVotes lines, you must output the following message to the screen: Precinct <precinct> reported <numVotes> votes using the current values for <precinct> and <numVotes> that were just read from the file. 3. Once all the results have been read from the file, output the following to the results.txt file: Candidate 1: <cand1Pct>% Candidate 2: <cand2Pct>% Other: <otherPct>% Total Votes: <totalVotes> where: <cand1Pct> is the percentage of the total votes that were cast for candidate 1 <cand2Pct> is the percentage of the total votes that were cast for candidate 1 <otherPct> is the percent...
View Full Document

Ask a homework question - tutors are online