Question: To be written in JAVA Board election needs your help to read the ballots and sum out who wins the election. Each ballot has the

To be written in JAVA

To be written in JAVA Board election needs your help to read

Board election needs your help to read the ballots and sum out who wins the election. Each ballot has the arrangement of a punch card, if the voter votes for a candidate; he/she fills the circle that corresponds to the candidate. The ballot will be like this: Candidate 1 Candidate 2 Candidate 3 Candidate 4 Jessica James Joan Jacob Each voter may vote for only at most two people. After reading each ballot, the result was saved in a text file for further reading and recording. The summary file is saved in the handout folder as vote.txt. Each voter's vote is represented in one line of four numbers, each number is either 1 which stands for vote for; or O which stands for vote against. For example, if the line says 0 1 0 1 it means that candidate 2 and 4 are chosen. Your job is to count the ballots and print voting result When you count, you need to do the following: 1. Store the ballots in two dimensional integer array, you may NOT process the ballot while reading the file 2. After reading, check if the ballot is valid: if more than two names are chosen, then the ballot is rendered invalid. 3. Summarize valid votes 4. State who are the winners (do NOT need to rank) 5. Count popularity vote of each candidate (invalid votes are counted) Board election needs your help to read the ballots and sum out who wins the election. Each ballot has the arrangement of a punch card, if the voter votes for a candidate; he/she fills the circle that corresponds to the candidate. The ballot will be like this: Candidate 1 Candidate 2 Candidate 3 Candidate 4 Jessica James Joan Jacob Each voter may vote for only at most two people. After reading each ballot, the result was saved in a text file for further reading and recording. The summary file is saved in the handout folder as vote.txt. Each voter's vote is represented in one line of four numbers, each number is either 1 which stands for vote for; or O which stands for vote against. For example, if the line says 0 1 0 1 it means that candidate 2 and 4 are chosen. Your job is to count the ballots and print voting result When you count, you need to do the following: 1. Store the ballots in two dimensional integer array, you may NOT process the ballot while reading the file 2. After reading, check if the ballot is valid: if more than two names are chosen, then the ballot is rendered invalid. 3. Summarize valid votes 4. State who are the winners (do NOT need to rank) 5. Count popularity vote of each candidate (invalid votes are counted)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!