Question
C++ Voting Election: There are 5 candidates to choose from. The council has polled 20 students on campus. You need to write a program that
C++ Voting Election: There are 5 candidates to choose from. The council has polled 20 students on campus. You need to write a program that tallies up the number of votes each candidate received and pronounces a winner.
Please use arrays to implement this assignment.
You are not allowed to use 'switch' or 'if' statements to count the votes.(except for finding the max) If there are more than 1 people who have the same highest vote counts, print there is no winner
Note: It is better if user could input their vote and vote again if they enter the wrong number
--
User will input 1,2,3,4, or 5 as their vote, 20 times.. in the end it will calculate which candidate (1-5) had the most votes. Pretty simple, Thank you!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started