Thank you very much in advance! Method Summary main Parameters: n/a Returns: n/a
ID: 3736217 • Letter: T
Question
Thank you very much in advance!
Method Summary main Parameters: n/a Returns: n/a Purpose: Manage the main flow of the game from start to end Call the displaylnstructions method Create players Prompt for number of players Create a String array for player names and an int array for scores Prompt for player names and store in the player names array (Scores will initialize to 0 for each player by creating the int array.) Manage rounds and turns within loops displaylnstructions Parameters: n/a Returns: n/a Purpose: Display welcome message and game instructions. rollDice Parameters: n/a Returns: points earned for the rol! Purpose: Using a random number generator, simulate rolling three 6-sided dice. Determine the score for the rofl and return that score value to the calling method. (Return 30 for triple, 20 for all unique, and 0 for double. Dispay the roll values and the score for the roll such as Rolled: 3 5 4 (roll value 20) Rolled: 3 6 6 (roll value 0) Rolled: 22 2 (roll value 30) takeTurn Parameters: current player name (as a String) Returns: points earned for the completed player's turn Purpose: Display points accumulated so far this turn, and ask player "Roll/Bank(R/B)?". f they choose "R", call the rollDice method and add the the returned score value to the accumulated points for this player's turn f rollDice returns a 0 (double drat), end the player's turn and return 0 to the main method if the player chooses "B", return the accumulated points from this turn to the main method Note: You'll need to create a Scanner in this method to prompt for "R/B". displayScoreboard Parameters: names (String) array and scores (int) array Returns: n/a Purpose: Print a scoreboard header that matches the sample output. Loop through the arrays and print the name and corresponding score for each player using values from the two arrays. Assume that the sort order of the scores array matches the order of the player names arrayExplanation / Answer
Thank you so much dear.
But it would have been much better if you would have asked a genuine question.
Good luck
Regards,
Online Teacher
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.