Question
1. Write a raptor code to solve the following problem: a) Ask for the number of candidates participating in a local election. Make sure the
1. Write a raptor code to solve the following problem:
a) Ask for the number of candidates participating in a local election. Make sure the number of candidates entered by the user is between 1 and 100. Ask the user to enter the first name, last name, and number of votes received by each candidate stored in 3 arrays. One array holds the first name, another array for the last names, and the third array holds the number of votes.
b) Display the Heading E L E C T I O N R E S U L T S and display the first name, last name, and the number of votes, one per line.
c) Find and display the first name, last name, number of votes, percentage of votes for the winner of the election. Find and display the first name, last name, number of votes, percentage of votes for the loser of the election. Display the array of votes in the reverse order they were entered. So, display the last value of the array first, etc. This is a very simple loop that starts at the last index of the array and counts down by 1.
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