subject

You will create a class called DiceArray. java which simulates the rolling of five six-sided dice 7,776 times and reports the number of Yahtzees (five of a kind) rolled. You will populate the array with a random number between 1 and 6, just like a set of dice. You will compare each index to see if you get five of the same number and keep tally of these Yahtzees. You will print each set of five "rolls" and after the final roll display how many Yahtzees occoured. A sample output could look like this(note this this shows the last four rolls but all rolls should print)

24132

41322

11234

12344

3 total Yahtzees after 7,776 rolls.

Part2:

Now build a 2-dimensional array that is 5x5 and populate it with random rolls like you did above. Once you’ve populated the 2-D array I want you to print the 2-D array to the output screen then print how many Yahtzees exist in each row, how many Yahtzees exist in each column and how many Yahtzees exist on the diagonals. A sample output could look like this

45631

52411

65121

41351

15321

There are 0 row Yahtzees

There are 1 column Yahtzees

There are 1 diagonal Yahtzees

Both part 1 and part 2 should reside in the same program

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, andyromero
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
image
Computers and Technology, 23.06.2019 07:30, Braxtonw875
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, lizziesuks
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
image
Computers and Technology, 24.06.2019 17:30, KaleahV
List at least one thing to check for when you're checking the clarity and professionalism of a document.
Answers: 1
You know the right answer?
You will create a class called DiceArray. java which simulates the rolling of five six-sided dice 7,...

Questions in other subjects:

Konu
Mathematics, 30.12.2019 05:31