Question: BlueJ java Add void assignPlayerInPosition(String player, String position) to assign a certain String player to a given String position MUST: first use findIndex( ) on
BlueJ java
Add void assignPlayerInPosition(String player, String position) to assign a certain String player to a given String position
MUST: first use findIndex( ) on formatString( ) of position to get the index
if returned index is valid within positions, assign formatString( ) of the player to within players at that index AND print ASSIGNED <getPlayerString( )>
else print ERROR invalid position
Add void takePlayerOut(String player) to take a String player out the players
MUST: first use findIndex( ) on findPlayerPosition( ) of the formatString( ) of the player to get the index within players to vacate
if index is valid within positions, print TAKEN OUT <getPlayerString( )> AND assign null to that index within players
else print ERROR invalid player
Add void printRoster( ) to print ALL players (even if N/A) with ALL positions
MUST: use toString( ) to 1st print heading (i.e. 2011 CHICAGO CUBS ROSTER:)
MUST: use for loop and getPlayerString( ) to print each player on its own line
Add void listPlayers( ) to ONLY print the player names in players if it exists
MUST: use toString( ) to 1st print heading (i.e. 2011 CHICAGO CUBS PLAYERS:)
MUST: use for-each loop to print each String player in players ONLY if it exists
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
