A program is required to simulate rolling a die three times


A program is required to simulate rolling a die three times and count the number of times a 6 is thrown on the die. Choose one of each pair of statements below and reorder them to write the program. Add indenting and braces { } appropriately. var count = 0; var count = 1;

dieRoll = Math.floor(Math.random()*6+1);

dieRoll = Math.floor(Math.random()*5+1);

if (dieRoll == 6)

if (dieRoll = 6)

alert(count);

alert('count');

count++;

count+1;

for (var i=0; i<3; i++)

for (var i=1; i<3; i++)

var dieRoll;

DIE_ROLL = 6;

Solution Preview :

Prepared by a verified Expert
JAVA Programming: A program is required to simulate rolling a die three times
Reference No:- TGS02850707

Now Priced at $10 (50% Discount)

Recommended (95%)

Rated (4.7/5)