Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started