View the step-by-step solution to:

Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate.

1.  Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate.  The program should then output each candidate's name, the votes received by that candidate, and the percentage of the total votes received by the candidate.  Your program should also output the winner of the election.  A sample output is:
Candidate Votes Received % of Total Votes
Johnson 5000 25.91
Miller 4000 20.72
Duffy 6000 31.09
Robinson 2500 12.95
Anthony 1800 9.33
Total 19300
The Winner of the Election is Duffy.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question