Question: Create a program in javascript to determine the winner of the Caldwell City Mayoral Race. public class ihill 2 { public static void main (
Create a program in javascript to determine the winner of the Caldwell City Mayoral Race.
public class ihill
public static void mainString args
Scanner scanner new ScannerSystemin;
String candidates new String;
int precinctOne new int;
int precinctTwo new int;
int precinctThree new int;
int totalVotes ;
int winnerCandidate precinctOneprecinctTwoprecinctThree;
input the canidates name and total votes
for int i; i; i
System.out.printlnEnter the name of the candidate:";
candidatesi scanner.nextLine;
System.out.printlnEnter how many votes in Precinct for candidatesi: ;
precinctOnei scanner.nextInt;
scanner.nextLine;
System.out.printlnEnter how many votes in Precinct for candidatesi: ;
precinctTwoi scanner.nextInt;
scanner.nextLine;
System.out.printlnEnter how many votes in Precinct for candidatesi: ;
precinctThreei scanner.nextInt;
scanner.nextLine;
display the total of votes
totalVotes precinctOneprecinctTwoprecinctThree;
System.out.printlnTotal Votes: totalVotes;
Candidates Precinct Precinct Precinct
Janet Wilson
Carlton Kinard
Carnella LeSaine
Christ Mathis
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
