Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

javascript html Write a script to simulate the rolling of two dice. The script should use Math.random to roll the first die and again to

javascript html

Write a script to simulate the rolling of two dice. The script should use Math.random to roll the first die and again to roll the second die. The sum of the two values should then be calculated. Since each die can show an integer value from 1 to 6, the sum of the values will vary from 2 to 12, with 7 being the most frequent sum, and 2 and 12 the least frequent sums. There are 36 possible combinations. Your program should prompt for the number of times to roll the dice, but should be a minimum of 10,000 times. Use a one dimensional array to tally the number of times each sum appears. Display the results in an HTML5 table. (Die_Total)

This exercise is similar to the previous exercise, but with some substantial differences. Write a script to simulate the rolling of two dice. The script should use Math.random to roll the first die and again to roll the second die. The two die make an ordered pair with the first die representing the row number and the second die representing the column number. Since each die can show an integer value from 1 to 6, the resulting table should have row values from 1 to 6 and the column values from 1 to 6. There are 36 possible combinations. Your program should prompt the user for the number of times to roll the dice, but should be a minimum of 10,000 times. Use a two dimensional array to tally the number of times each combination appears. Display the results in an HTML5 table. (Die_Combination)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Why are limited liability companies advantageous?

Answered: 1 week ago

Question

Draw a picture consisting parts of monocot leaf

Answered: 1 week ago

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago