Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions: Use arrays to write code io Raptor to process voting data. Steps: 1. Ask for the number of candidates participating in a local election.
Instructions: Use arrays to write code io Raptor to process voting data. Steps: 1. Ask for the number of candidates participating in a local election. Asktheuser to enter thelast names of terriebofcaruerates are the number of votes 3. received by each candidate stored in 2 arrays. One array holds the name of the candidates and the other holds the number of votes they received After all data has been entered, display the name and the number of votes, one per line. 4. Calculate and display the total number of votes. Calculate and display the percentage of the total votes received by the candidate. Percentage is calculated by dividing each vote by the total number of votes multiplied by 100. Use an array to hold the percentage of votes. S. 6. 7. Find and display the winner of the election along with the number of votes received. Notes: To find the candidate with the most win, you can find the highest value in the array of votes and use its index to identify the candidate with the highest vote
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