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

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, volleyballfun24
If the thermal strain developed in polyimide film during deposition is given as 0.0044. assume room temperature is kept at 17.3 c, and thermal coefficient of expansion for the film and the substrate are 54 x 10^-6c^-1 and 3.3 x 10^-6c^-1respectively. calculate the deposition temperature.
Answers: 3
image
Engineering, 03.07.2019 15:10, EmilySerna
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
image
Engineering, 04.07.2019 18:10, jadeochoa4466
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 18:10, meganwintergirl
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
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 in other subjects: