Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c programming, can only use functions given and text file is: In instant runoff voting (IRV), voters rank their choice of candidates instead of choosing
c programming, can only use functions given and text file is:
In instant runoff voting (IRV), voters rank their choice of candidates instead of choosing a single candidate. If no candidate has received a majority of the first-place votes, the last- place candidate is removed, and that candidate's votes are reassigned to the next preference of the voter. For example, if you have the following votes for 5 candidates by 7 voters where the candidates are CA, CB, CC, CD, and CE: Voter 1: CA, CB, CC, CD, CE Voter 2: CA, CB, CC, CD, CE Voter 3: CA, CB, CC, CD, CE Voter 4: CC, CB, CA, CD, CE Voter 5: CB, CC, CD, CE, CA Voter 6: CB, CC, CD, CE, CA Voter 7: CB, CC, CD, CE, CA Both CA and CB have 3 first-place votes, but neither have a majority. So, we remove the last-place candidate. Neither CD or CE received any votes, so we will remove both of them. When their votes are reassigned, we get the following in the 2nd round: Voter 1: CA, CB, CC Voter 2: CA, CB, CC Voter 3: CA, CB, CC Voter 4: CC, CB, CA Voter 5: CB, CC, CA Voter 6: CB, CC, CA Voter 7: CB, CC, CA We still have CA and CB with 3 first-place votes, but no majority. The last-place candidate now is CC, and we reassign its votes for round 3: Voter 1 : CA, CB Voter 2: CA, CB Voter 3: CA, CB Voter 4: CB, CA Voter 5: CB, CA Voter 6: CB, CA Voter 7: CB, CA Now, CB has 4 votes and CA has 3 votes, and since 4 votes is a majority, CB is declared the winner after round 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started