subject
Engineering, 23.09.2020 23:01 mikailah0988

Part A. you'll build on the CoinFlip. java program. The coin simulation asked you to flip a coin 1000 times and report the outcomes. For Lab 1, you should create a class called DiceSim. java (or similar), which simulates the rolling of five six-sided dice 7,776 times and reports the number of Yahtzees (five of a kind) rolled. You'll either need to use a random generator (java. util. Random) or reuse the Math. random() function, but you'll need to tweak it to simulate a die with sides 1..6 in place of a coin with only 0 and 1 as options. Make sure you don't roll any 0's or 7's...Part B. 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 diagnals. A sample output could look like this1. 456312. 524113. 651214. 413515. 15321A. There are 0 row Yahtzees. B. There are 1 column Yahtzees. C. There are 1 diagonal Yahtzees. Both part A and part B should reside in the same program.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Items are similar to the free issue items, but their access is limited. (clo5) a)-bin stock items free issue b)-bin stock controlled issue c)-critical or insurance spares d)-rebuildable spares e)-consumables
Answers: 1
question
Engineering, 04.07.2019 19:10
Apressure vessel with an r/t 20 cannot be treated as thin walled vessel. a)-trune b)- false
Answers: 3
question
Engineering, 04.07.2019 19:10
What is the chief metrological difference between measuring with a microscope and with an electronic comparator? a. the microscope is limited to small workpieces.a. the microscope is limited to small workpieces. c. the comparator can only examine one point on the workpiece. d. the microscope carries its own standard.
Answers: 1
You know the right answer?
Part A. you'll build on the CoinFlip. java program. The coin simulation asked you to flip a coin 100...
Questions
question
Arts, 24.10.2020 07:50
question
Social Studies, 24.10.2020 07:50
question
Mathematics, 24.10.2020 07:50
Questions on the website: 13722362