Question
Draw a flowchart and write a program in java that allows the user to enter the last names of five candidates in an election and
Draw a flowchart and write a program in java that allows the user to enter the last names of five candidates in an election and the number of votes received by each candidate. The program then outputs each candidate's name, the number of votes received by the candidate. The program also outputs the winner of the election. Use three arrays: one array to store the candidates name, one array to store the number of votes.
Must use the following 4 methods for this program:
A method for inputing the names and votes (create the scanner object in this method) received by each candidate.
A method that returns the total votes,
A method that returns the percentage of total votes received by each candidate.
A void method that displays the result (names, votes, percentage of total votes, total votes, winner)
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