Write a script to simulate the rolling of two dice

Assignment Help Other Subject
Reference no: EM13220333

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. [note: 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 numbers of times each possible sum appears. Display the results in an XHTML 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: EM13220333

Questions Cloud

Expain how mccaryism affected the lived : Expain how mccaryism affected the lived and political thinking of people in the u.s. Defend mccaryism as appropriate or criticize it as inappropriate for the time in which it occured.
Favorite films-fictitious or biographical : Think about a character from one of your favorite films, fictitious or biographical.
Demographic and socioeconomic standpoint : What does the typical public school child look like from a demographic and socioeconomic standpoint? What is the typical budget expended on pk-12 public schooling in the united states? Break this down by individual states.
List some products both hazardous and non hazardous : list some products both hazardous and non hazardous that you would deal with in a nursing home and how you would protect yourself and others from harm/contamination when using them
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. The sum of the two values should then be calculated
Explain the notion of a collective conscience : Explain the notion of a collective conscience, offered by David Emile Durkheim and briefly compare the similarities and differences of class consciousness and collective conscience,
Effect of employee hiring policies on private security : effect of employee hiring policies on private security.
Stamp act- quartering act : At the same time that Parliament imposed the Stamp Act, it also passed the Quartering Act, which required...
Economic conditions for casual day laborers : Around 1820-1840, the economic conditions for casual day laborers in American cities...

Reviews

Write a Review

 

Other Subject Questions & Answers

  Differences between reality and the worlds described

What are the differences between Reality and the worlds described in the stories we read for this week? Are these alternate worlds just a space for wish-fulfillment fantasies? What is the value of imagining a different kind of reality?

  Different marginalized populations

What would you say is the overall lesson from the simulation activity? How do you improve communication between caregivers and patients with low health literacy? Patients with disabilities? Children?

  Logistics functions in supply chain

Describe the key logistics functions in a supply chain.

  Constitutionality of bar on hiring former government employe

Discuss the constitutionality of a bar on hiring former government employees or former members of Congress as lobbyists

  Problem drinker and alcoholic

What is the difference between a problem drinker and an alcoholic? What factors can cause someone to become an alcoholic? What resources did you use to help you answer this discussion question?

  Direct sequence spread-spectrum system

A message is transmitted at bit rate of 9.6 kb/s using a direct sequence spread-spectrum system. The clock rate of the code sequence is 512 Mb/s.

  Determine the culture of exclusion

Determine the culture of exclusion, according to MacLean? Who was excluded in U.S. by this culture? Write down examples to explain your claim.

  Describing a dermatologic condition or disease

write a ficticious medical report of about 2 paragraphs describing a dermatologic condition or disease.

  Limiting medical attention is equivalent to euthanasia

Do you think limiting medical attention is equivalent to euthanasia or is there a difference in the two though processes?

  Communicating patient-specific information

Include an assessment of how the Internet, or any other form of electronic communication, may be used as an external delivery source in communicating patient-specific information.

  Strengths and weaknesses of the articles of confederation

Describe the strengths and weaknesses of the Articles of Confederation. Why didn't the Articles of Confederation have more than one branch of government? What important powers did the Confederation Congress lack? How did these deficiencies cause prob..

  How many minimum number of turns

Note that whenever all the holes are either open or close, there will be an alarm so that the blindfolded man will know that he has won.

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