Write a script to simulate the rolling of two dice

Assignment Help Computer Engineering
Reference no: EM132213364

Question :

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.

Your program should roll the dice 36,000 times. Use a one-dimensional array to tally the number of times each possible sum appears.

Display the results in an HTML5 table. Also determine whether the totals are reasonable (e.g., there are six ways to roll a 7, so approximately 1/6 of all the rolls should be 7).

Reference no: EM132213364

Questions Cloud

Compute the sum of the items in the list using attributes : Write sematic rules for each production that compute the sum of the items in the list using attributes grammar.
Describe underwriter profits from the overallotment option : Explain what will happen if the price of the stock increases to $22. Describe the underwriter profits from the overallotment option in your explanation.
Write a sequence of statements that use only push and pop : Write a sequence of statements that use only PUSH and POP instructions to exchange the values of eax and ebx registers.
Identify and describe the two companies you have researched : BUGEN 5930 Business, Society and the Planet Assignment, Federation University, Australia. Identify and describe the two companies you have researched
Write a script to simulate the rolling of two dice : 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.
What are the critical elements of an internet banking system : Discuss the different frameworks with which banks need to comply? What are the critical elements of an Internet banking system?
Write a section of a matlab code to delay an arbitrary : Write a section of a matlab code to delay an arbitrary signal, x(t) , by a time to . Test your code using the Matlab code.
Compute the taxable gain or loss : A tax payer acquires an asset through manufacturing it and he incurred the following costs: direct material SR 100,000, direct labor SR 50,000 and manufacturing
Allow a user to enter a numeric grade and then determine : Write a script that allows a user to enter a numeric grade and then determine the letter grade.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Use an x, y translation transform

Several multi exposure image sequences (of three images) will be released on the day the assignment is marked.

  Write statements that extract the substring moon

Write statements that convert and print the lower case letters in the String computer to upper case letters.

  Write an implementation of this method for the class

Suppose that you want an operation for the ADT list that adds an array of items to the end of the list. The header of the method could be as follows.

  How many ways are there for her to distribute the points

How many ways are there for her to distribute the points if a particulat student, Amanda, gets no more than 10 points?

  Design an organizational unit ou structure

Based on the employee and resource information you have been provided, design an organizational unit (OU) structure that will support

  Each station outputs an 80 bytes frame and buffers

A group of stations share a 16 kbps slotted Aloha channel. Each station outputs a 80 Bytes frame and buffers any outgoing frames until they can be sent.

  Discuss any form of physical access control

Discuss any form of physical access control, and reference a time when you have used this form of physical access control to provide security to an information.

  What types of memory will you use and why

What types of memory will you use and why? In the example of a music-streaming device, we can use cache memory to store temporary song as they are being played.

  Write an application with three check boxes

Write an application with three check boxes labeled "Red", "Green", and "Blue" that adds a red, green, or blue component to the background color of a panel.

  Create a spreadsheet that shows the number of folds

Create a spreadsheet that shows the number of folds from 0 to 50 and the resulting thickness of each fold.

  What is purpose of random access memory in computer system

What is the purpose of random access memory in the computer system? permanently simultaneously? Which of the following hacking-related developments occurred after the year 2000?

  Write a program that creates a new file

Write a program that creates a new file, writes 100KB to it, flushes the writes, and deletes it. Time how long each of these steps takes.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd