Question: Add a counter to your roll.html page to record the number of rolls that occur before doubles are obtained. Recall that a counter consists of

Add a counter to your roll.html page to record the number of rolls that occur before doubles are obtained. Recall that a counter consists of a variable that is initialized to zero and incremented every time some event occurs. In this case, you should declare and initialize the counter variable in the RollUntil function, then add code to increment the counter each time the dice are rolled. When doubles are finally obtained, your page should display the counter's current value in a page division.

Use your page to conduct 20 different experiments, counting how many times it takes to obtain doubles each time. Are your results consistent with the universal odds of rolling doubles?

Step by Step Solution

3.39 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1409-C-S-O-S(1093).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!