Write a C++ program that allows the user to enter the last names of candidates i
ID: 643309 • Letter: W
Question
Write a C++ 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. Program must make use of a struct called Candidate. You must store the vote results in an array of Candidate records.
Explanation / Answer
If you need a better resource, try this: http://cplusplus.com/doc/tutorial/
Forgive me if this C++ is a bit amateur... I'm a Java programmer, but the code does what you want and I think you'll figure out what you need. http://pastebin.com/Cb6ueTif
Keep in mind a structure is just something that contains data. There can be multiple instances. Let me know if you have any questions, I tried to comment all the major points
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.