Question: java A class called Team is shown in the following UML diagram. The purpose is to maintain a list of player namnes. Team -players 11:
A class called Team is shown in the following UML diagram. The purpose is to maintain a list of player namnes. Team -players 11: String - count: int + Team (size:int) getCount(): int +addPlayer (name: String) + getPlayer(index: int): String toString(): String 3. Code just the attribute definitions for this class. (1 mark) b. The constructor has an integer parameter that is the size of the team to be allocated. Code just the constructor (2 marks) c. The adaplayer method has a string parameter that is the next player name to add to the team. Each time a player is added to the team, the count is incremented. If the team s already full an error message is issued instead. Code this method. (3 marks) d. Code the driver statements (not a whole main) to exercise the constructor and the addPlayer method. Assume that all the other methods have been coded and work as required
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
