There are six different dice combinations that add up to 7: 6-1, 5-2, 4-3, 3-4, 2-5, and

Question:

There are six different dice combinations that add up to 7: 6-1, 5-2, 4-3, 3-4, 2-5, and 1-6, making it the most common dice roll. Add an additional text span to your stats.html page that keeps track of the number of times the user rolls dice that total 7. The new SPAN element should appear below the existing ones, and should be preceded by an appropriate label. Within the RollDice function, add an if statement that checks whether the two rolls add up to 7 and, if so, increments the sevens counter in the text span. This counter should also be reset to 0 when the user clicks on the reset button (from Exercise 11.7).

Once you have done this, use your page to simulate repeated dice rolls. After a reasonable number of rolls, is your sevens count roughly one-sixth of the total number of rolls?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: