Question: 1. Copy and paste the Student class code from 1ast week into WK5C1ass project. Add two constructors to the class: one that takes no arguments

 1. Copy and paste the Student class code from 1ast week

into WK5C1ass project. Add two constructors to the class: one that takes

1. Copy and paste the Student class code from 1ast week into WK5C1ass project. Add two constructors to the class: one that takes no arguments and another that takes two arguments. Test your c1ass by creating a Student object called sl with the constructor that takes two arguments and using its accessor and mutator methods. 2. Add a Java Class file called VotingMachine.java to WK5C1ass project. Implement a VotingMachine classIthat can be used for a simple election. - A voting machine has two properties- Purple votes and Green votes - Write a constructor that accepts no arguments and sets the votes for both parties to 0 - Write methods (note that none of these methods take any arguments or return any values) - void clear() to reset the votes for each party to 0 gramming Concepts \& Implementing Classes Spring 2023 - void votePurple() that increases the purple votes by 1 - void voteGreen() that increases the green votes by 1 - void printVotes() that prints the tallies of the votes for both parties in this way: Purple Votes: 6 Green Votes: 10 - Identify the accessor methods (access/read/gets properties) and mutator methods (change/modify/sets properties) - Test your class: Create a voting machine object called vml. Then vote for each party mu1tiple times by calling the votePurple and voteGreen methods multiple times and then print the votes received by each party by using the printVotes method. Then clear the votes by using the clear method and reprint the votes of each party

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!