Question: Enter the stats.html text from Figure 11.7 into a new Web page, then load the page in the browser to verify that it behaves as

Enter the stats.html text from Figure 11.7 into a new Web page, then load the page in the browser to verify that it behaves as described.

Add an additional text span to your stats.html page that serves as a conditional counter, keeping track of the number of times the user rolls doubles. The new SPAN element should appear below the existing one that displays the number of rolls, and should be preceded by an appropriate label. Within the RollDice function, add an if statement that checks whether the two rolls are identical and, if so, increments the doubles counter in the text span.

Statistically speaking, users should obtain doubles on 1/6th their rolls. This is attributable to the fact that 6 out of the 36 possible dice combinations are doubles. After a reasonable number of rolls, is your doubles count roughly one-sixth of the total number of rolls?

Step by Step Solution

3.41 Rating (173 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(1064).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!