Question: Java question: Game class1. Add a constructor to do the following a. Access level modifier public b. Empty parameter list c. Call method createPlavers, d.

Java question:

Java question: Game class1. Add a constructor to do the following a.

Game class1. Add a constructor to do the following a. Access level modifier public b. Empty parameter list c. Call method createPlavers, d. Call method displaPlayers, e. Call method playGame 2. Add method greatePlayers to do the following a. Access level modifier private b. Retum type void c. Empty parameter list d. Instantiate the member variable of class away| representing the collection of class Player Instantiate an instance of class Scanner so it takes input from the console Prompt the user from the console to enter e. f. ir name and store the value in an instance of class String Instantiate an instance of class g. h. Call method setName in class Player for the instance of class ass as an argument the data read from the console Instantiate and instance of class AiPlaver Call method set Name in class Player for the instance of class AiPlaver passing as an argument a string the AI plaver's name Add to the member variable of class AmayL.ist representing the collection of class Plaver the instance of class i. j. k. above 3. Add method displayPlayers to do the following a. b. c. d. Access level modifier private Returm type void Empty parameter list Loop through the member variable of class ArayList representing the collection of class Player i. Output to the console each player's name by calling method getName in class Plaver for each instance 4. Add method playGame to do the following a. b. c. d. Access level modifier private Return type void Empty parameter list Loop through the member variable of class Amavbist representing the collection of class Player i. Call method rollDice in class Player passing as an argument the member variable of class Roll Call method displavDice in class ii. Game class1. Add a constructor to do the following a. Access level modifier public b. Empty parameter list c. Call method createPlavers, d. Call method displaPlayers, e. Call method playGame 2. Add method greatePlayers to do the following a. Access level modifier private b. Retum type void c. Empty parameter list d. Instantiate the member variable of class away| representing the collection of class Player Instantiate an instance of class Scanner so it takes input from the console Prompt the user from the console to enter e. f. ir name and store the value in an instance of class String Instantiate an instance of class g. h. Call method setName in class Player for the instance of class ass as an argument the data read from the console Instantiate and instance of class AiPlaver Call method set Name in class Player for the instance of class AiPlaver passing as an argument a string the AI plaver's name Add to the member variable of class AmayL.ist representing the collection of class Plaver the instance of class i. j. k. above 3. Add method displayPlayers to do the following a. b. c. d. Access level modifier private Returm type void Empty parameter list Loop through the member variable of class ArayList representing the collection of class Player i. Output to the console each player's name by calling method getName in class Plaver for each instance 4. Add method playGame to do the following a. b. c. d. Access level modifier private Return type void Empty parameter list Loop through the member variable of class Amavbist representing the collection of class Player i. Call method rollDice in class Player passing as an argument the member variable of class Roll Call method displavDice in class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!