Write a program that simulates the rolling of two dice

Assignment Help Basic Computer Science
Reference no: EM131374893

(Dice Rolling) Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. [Note: Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] Figure 7.26 shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).

2061_bd055eba-9e72-4342-8794-8917c7640c3c.png

Reference no: EM131374893

Questions Cloud

Construct a break even graph showing the annual worth : For what break-even salvage value will he be indifferent between taking taxis and buying a car? Construct a break-even graph showing the annual worth of both alternatives as a function of the salvage value of the car. What advice would you give Ga..
Do you still think business plans are needed and why : So, do you still think business plans are needed? Why? Do you think that quality (completeness of vision) of the plan is an indicator of success?
Discuss the status of women : Discuss the status of women in late eighteenth-century/early nineteenth-century England as it is depicted in the excerpt from Pride and Prejudice, using examples from the text.
Construct table that shows the annual worth of the clip job : Construct a table that shows the annual worth of the Clip Job for annual maintenance costs varying from $30 per year to S80 per year.
Write a program that simulates the rolling of two dice : Print the results in a tabular format. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).
Develop a position paper on best practices : Develop a position paper on best practices for teaching English Learners. This paper should contain the student's personal beliefs about and the best models to practice.
What about fare trade living wage and child labor : Should you require that your suppliers comply with Environmentally Friendly practices? What about fare trade, living wage, child labor, and other social considerations?
Discuss about the post given below : Some would argue that incentives are the key to retaining and attracting employees. It has been noted that there are various types of incentive plans. Discuss the advantages and disadvantages of individual incentive plans, team incentive plans, va..
Write a recursive function printarray that takes an array : The function should stop processing and return when the starting subscript equals the ending subscript.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Could a packet with all 0s or all 1s be a legal ipv4 packet

Could a packet with all 0s or all 1s be a legal IPv4 packet? Will the Internet checksum catch that error? Why or why not?

  Why do some block cipher modes of operation only

Why do some block cipher modes of operation only use encryption while others use both encryption and decryption?

  Npv analysis without a cost of capital

Do you think the same kind of analysis can or should be done in small companies, non-profits or schools? Given that they don't have publicly traded stocks or bonds how would you go about doing NPV analysis without a cost of capital?

  Wired and wireless connectivity

The design features for your home office network should include wired and wireless connectivity, the applications and operating systems use on the network, and shared network resources (files, printers). Include as much information as you can in your..

  Compute an analysis of variance table for these data

Compute an analysis of variance table for these data and test the null hypothesis that all four treatments yield the same average moisture contents.

  Give an example of a uri that is not a url

Explain the relationship between uniform resource locators (URLs) and uniform resource identifiers (URIs)

  How peter can restrict access to the file design to himself

Show how Peter can restrict access to the file design to himself and Deborah using only abbreviated ACLs. (Hint: Consider both design and its containing directory.)

  Describe two sampling methods to select independent groups

Describe two sampling methods to select independent groups

  Population distribution is exactly normal

The most important condition for sound conclusions from statistical inference is usually

  Despite the growing number of security incident

Despite the growing number of security incidents, cybersecurity risks and threatsare still notoriously hard to quantify and estimate.

  Construct an e-r diagram for a car insurance company

Each payment is for a particular period of time, and has an associated due date, and the date when the payment was received.

  Virtual computing and/or cloud computing

Create your own Disaster Recovery and Business Continuity Plan. You need to be sure to include (in detail) how your plan will allow for the necessary Availability, Maintainability, Portability, and Reliability. You also need to address if your plan s..

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