2.Write a program that allows the user to enter the names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s 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. A sample output is: Candidate Votes Received % of Total Votes Aslam 5000 25.91 Ali 4000 20.73 Raza 6000 31.09 Bilal 2500 12.95 Hammed 1800 9.33 Total 19300 The Winner of the Election is Raza.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 13E
icon
Related questions
icon
Concept explainers
Question

2.Write a program that allows the user to enter the names of five candidates in a local election
and the number of votes received by each candidate. The program should then output each
candidate’s 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. A sample output is:
Candidate Votes Received % of Total Votes
Aslam 5000 25.91
Ali 4000 20.73
Raza 6000 31.09
Bilal 2500 12.95
Hammed 1800 9.33
Total 19300
The Winner of the Election is Raza.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr