Write a program that allows the user to enter the last names of candidates in a local election and the number of votes received by each candidate. The user will first specify the number of candidates involved in the election. After the user enters all the data, the program should then output each candidates name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election.
Your program must make use of a struct called Candidate.
You must store the vote results in an array of Candidate records.
Here is sample output, with the user's input shown in bold.
VOTE COUNTER 2011: LET YOUR VOICE BE HEARD
How many candidates participated? 5
For each candidate, enter his or her last name and number of votes received:
Candidate #1: Johnson 5000
Candidate #2: Miller 4000
Candidate #3: Duffy 6000
Candidate #4: Robinson 2500
Candidate #5: Ashton 1800
Here are the results:
Candidate Votes Received % of Total
-----------------------------------------------------
Johnson 5000 25.91
Miller 4000 20.72
Duffy 6000 31.09
Robinson 2500 12.95
Ashton 1800 9.33
-----------------------------------------------------
Total 19300
The Winner of the Election is Duffy.
Program in Bloodshed Dev C++