Answered step by step
Verified Expert Solution
Question
1 Approved Answer
folder called 07.05Assignment in yourModule07assignments folder. Copy yourElectionTesterV1.javaandElectionTesterV2.javafiles to the new folder. Rename V1 to V3 and V2 to V4. Be sure to update the
- folder called07.05Assignmentin yourModule07assignments folder.
- Copy yourElectionTesterV1.javaandElectionTesterV2.javafiles to the new folder. Rename V1 to V3 and V2 to V4. Be sure to update the class statement as well, to reflect the new versions.
- Modify theElectionTesterV3program to include the following:
- a method that will find a particular candidate by name and change the name for that candidate. Its arguments should include the array, a name to find, and the replacement name.
- a method that will find a particular candidate by name and change the number of votes for that candidate. Its arguments should include the array, a name to find, and the replacement votes.
- a method that will find a particular candidate by name and replace both the name and number of votes for that candidate. Its arguments should include the array, a name to find, the replacement name, and the replacement votes.
- Test your program by calling each of the methods. Be sure to print the election results after each change. See the sample output below. Clearly announce the change that should occur so someone reading your output knows which change occurred.
- change a candidate's name
- change a candidate's vote count
- change a candidate by replacing the name and number of votes
- Now modify theElectionTesterV4class that uses an ArrayList to include the same functionality as the array version.
Expected Output:This is a sample of the expected output. The details will vary based on design choices you make while completing the project.
- folder called07.05Assignmentin yourModule07assignments folder.
- Copy yourElectionTesterV1.javaandElectionTesterV2.javafiles to the new folder. Rename V1 to V3 and V2 to V4. Be sure to update the class statement as well, to reflect the new versions.
- Modify theElectionTesterV3program to include the following:
- a method that will find a particular candidate by name and change the name for that candidate. Its arguments should include the array, a name to find, and the replacement name.
- a method that will find a particular candidate by name and change the number of votes for that candidate. Its arguments should include the array, a name to find, and the replacement votes.
- a method that will find a particular candidate by name and replace both the name and number of votes for that candidate. Its arguments should include the array, a name to find, the replacement name, and the replacement votes.
- Test your program by calling each of the methods. Be sure to print the election results after each change. See the sample output below. Clearly announce the change that should occur so someone reading your output knows which change occurred.
- change a candidate's name
- change a candidate's vote count
- change a candidate by replacing the name and number of votes
- Now modify theElectionTesterV4class that uses an ArrayList to include the same functionality as the array version.
Expected Output:This is a sample of the expected output. The details will vary based on design choices you make while completing the project.
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