Question: 2. (25 points) Fill in the template below to make a complete class definition for a class that describes a very simplified scoreboard for a


2. (25 points) Fill in the template below to make a complete class definition for a class that describes a very simplified scoreboard for a video game. The scoreboard is implemented using two ArrayLists - one list to store the name of the player, and a second one to store the player's score. The two lists are stored in parallel - meaning that the indices of a player and their score will be the same. For example, the player at index 0 in the list players will have their score stored at index in the list scores The class's constructor and mutator methods MUST be implemented with the following constraints: 1. The sizes of the two lists must be the same at the end of any SimpleScoreboard method call. 2. The strings in the list players must always be unique 3. A player at position n in the list players will have their score at position n in the list scores Make sure your code conforms to the instructions given in the comments for each method. Note: You are also being asked to write the code for a private helper method named getIndexOfPlayer Make sure you are using this method in your accessors and mutators where appropriate to receive full credit! You may use the ArrayList methods on the back page when solving this problem. public class SimpleScoreboard { private ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
