Create a Web page named repavg.html that simulates a large number of dice rolls and computes the

Question:

Create a Web page named repavg.html that simulates a large number of dice rolls and computes the average of the dice totals. The user should be able to enter a number of rolls in a text box and then click a button, which should call a function to simulate the rolls and compute the average. Once calculated, the average should be displayed in a separate text box.

To compute the average, you must maintain a running sum of the dice rolls. Start by declaring a variable and initializing it to 0 (as you would with a counter). Each time the page simulates a dice roll, add the combined total of the two dice to the variable. Once the loop terminates, divide the sum of all your dice combinations by the number of dice rolls to determine the average roll.

After implementing your page, use it to answer the following questions. What is the average of 100 dice rolls? 1,000 dice rolls? 10,000 dice rolls? Is there a pattern to the numbers you obtain? Should there be?

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

Step by Step Answer:

Question Posted: