Question: JAVA Programming Language Write a program that prompts for an integer N, and allows the user to enter the last names of N candidates in

JAVA Programming Language

Write a program that prompts for an integer N, and allows the user to enter the last names of N candidates in a local election and the number of votes received by each candidate. The program then outputs each candidates name, the number of votes received, and the percentage of the total votes received by the candidate. The program also outputs the winner of the election.

(1) Prompt the user to input 4 candidates and the number of votes, then display the inputs (3 points).

Enter an integer: You entered: 4 Enter 4 names and numbers: You entered: King 5000 Harris 3500 Jones 6000 Duffy 1900 

(2) Calculate the total votes received and percentage of received by each candidate (4 pts)

Candidate Votes Received % of Total Votes King 5000 30.49 Harris 3500 21.34 Jones 6000 36.59 Duffy 1900 11.59 Total 16400 

(3) Fine the Winner (3 pts)

The Winner is Jones.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!