Question: JAVA problem, thank you Use the following file: VotingMachineTester.java public class VotingMachineTester { public static void main(String[] args) { VotingMachine machine = new VotingMachine(); machine.voteYes();

JAVA problem, thank you

JAVA problem, thank you Use the following file: VotingMachineTester.java public class VotingMachineTester

Use the following file:

VotingMachineTester.java

public class VotingMachineTester { public static void main(String[] args) { VotingMachine machine = new VotingMachine(); machine.voteYes(); machine.voteYes(); machine.voteYes(); machine.voteNo(); machine.voteYes(); machine.voteNo(); machine.voteNo(); System.out.println("Yes: " + machine.getYesVotes()); System.out.println("Expected: 4" ); System.out.println("No: " + machine.getNoVotes()); System.out.println("Expected: 3" ); } }

3B Write a VotingMachine class that models a simple voting machine to tally the votes on a California proposition. VotingMachine has a constructor with no parameters and initializes the yes and no counts It has methods voteYes voteNo getYesVotes getNoVotes There is no starter file for this project, but there is a tester Provide Javadoc for the constructor, all methods and the class itself

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!