Answered step by step
Verified Expert Solution
Link Copied!

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

  1. folder called07.05Assignmentin yourModule07assignments folder.
  2. 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.
  3. Modify theElectionTesterV3program to include the following:
    1. 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.
    2. 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.
    3. 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.
  4. 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.
    1. change a candidate's name
    2. change a candidate's vote count
    3. change a candidate by replacing the name and number of votes
  5. 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.

  1. folder called07.05Assignmentin yourModule07assignments folder.
  2. 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.
  3. Modify theElectionTesterV3program to include the following:
    1. 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.
    2. 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.
    3. 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.
  4. 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.
    1. change a candidate's name
    2. change a candidate's vote count
    3. change a candidate by replacing the name and number of votes
  5. 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.

Print

image text in transcribed
Bluel: Terminal Window - Module 7 0 X Options Original Results: Votes % of Total Candidate Recieved Votes Tony Stark 751 40 . 46 Henry Pym 496 26.72 Bruce Banner 303 16.33 S. R. 225 12 . 12 C. D 81 4.36 The total number of votes is: 1856 > Votes % of Total Candidate Recieved Votes Tony Stark 751 40 . 46 Henry Pym 496 26.72 Stan Lee 303 16.33 S. R. 225 12 . 12 C. D 81 4.36 The total number of votes is: 1856 > Votes % of Total Candidate Recieved Votes SEEE SEES Tony Stark 751 45.68 Henry Pym 284 17.27 Stan Lee 303 18.43 S. R. 225 13.69 C. D 81 4.93 The total number of votes is: 1644

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions