Question: Using the Python language: Write a main program and any necessary functions required to implement a scrutineer's voting machine. The scrutineer is the one that
Using the Python language: Write a main program and any necessary functions required to implement a scrutineer's voting machine. The scrutineer is the one that counts the votes and figures out who won the election. You are writing the program for just the scrutineer to use. Design the program so that the program determines the vote counts for each candidate and find out who won the election. Begin the program by asking how many candidates are running in the election. Then, ask for the last names belonging to each candidate. Next, begin entering the votes. The scrutineer will open the ballot box and will take out each ballot one by one. The scrutineer will enter the index number of the person who was voted for on the ballot.
Issues to Consider:
AThe program will only work for or more candidates BThere could be ties. Deal with the case where more than candidate is tied for the win.
CGuard against invalid vote entries, ieindices which are out of range
DKeep track and report on the number of valid votes cast.
EKeep track and report on the number of spoiled ballots. A spoiled ballot is not a valid vote cast.
FConclude the program by announcing who won the election and how many votes the winner had.
GAssume the scrutineer will enter a valid integer data type when requested by the program.
SAMPLE SESSION
How many candidates are running eg
Thank you good bye. You need more than candidate to continue.
SAMPLE SESSION How many candidates are running eg
Enter lastname of candidate #Trump
Enter lastname of candidate #Biden
Enter lastname of candidate #Salamanca
List of Candidates
for a spoiled ballot
Trump
Biden
Salamanca
to quit
Enter a vote using the index number beside each candidate.
Enter a vote eg or to quit
Enter a vote eg or to quit
Error: is an invalid vote
Enter a vote eg or to quit
Enter a voteeg or to quit
Enter a voteeg or to quit
Enter a voteeg or to quit
Enter a voteeg or to quit
Enter a voteeg or o quit
Election Results
Trump
Biden
Salamanca
numbers spoiled: Total valid votes cast:
The winner is Biden with votes
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
