Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Finish the program in java to determine the winner of the Caldwell City Mayoral Race. public class ihill 2 { public static void main (
Finish the program in java 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;
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