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

  Critical need for information security

Identify at least three (3) benefits or key knowledge points that could be derived from using cyber-attack simulator systems and research, and suggest how this insight could assist in defining the needs for security within an organization.

  Describe why suggestion of connecting by twisted pair cable

Describe why you would suggest connecting all current and new client computers using twisted pair cable instead of staying with the current coax wiring structure.

  Assign the contents of the text box to the variable

In the button's click event procedure, declare a double variable named dblNum. Use an assignment statement to assign the contents of the text box to the variable.

  What interface does an application need to use

What interface does an application need to use if it wants to get updates on the current position of the mouse cursor? How does the program get the x,y coordinates of the mouse cursor?

  Connect a circuit-switched private branch exchange

Which technology would we use to connect a circuit-switched Private Branch Exchange (PBX) to Central Office (CO), a T-1 voice trunk carries multiple conversations?

  Html page with javascript using if statement

The game of "23" is a two-player (computer versus player) game that begins with a row of 23 toothpicks. Players take turns, withdrawing 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game.

  Steps to encode the analog signal into a pcm signal

In a PCM system, the bit error rate due to channel noise is 10-4. Assume that the peak signal-to-noise ratio on the recovered analog signal needs to be at least 30 dB.

  Modify the cellular telephone coding system

To communicate one bit of information reliably, cellular phones transmit the same binary symbol five times. Thus the information "zero" is transmitted as 00000 and "one" is 11111. The receiver detects the correct information if three or more binar..

  Create a new string to represent the corresponding full name

Create a new string to represent the corresponding full name, and display it on screen in format: Lastname, Firstname, Middle name.

  Successful automobile manufacturing industry

As part of your discussion, keep in mind that the U.S. already has another successful automobile manufacturing industry, but it is not centered in the north of the country. Toyota, Honda, Daimler-Benz, and others have manufacturing plants in the ..

  Design a 4-bit register based on four d flip-flops

Design a 4-bit register based on four D flip-flops with three inputs I (4-bit), c (2-bit), and clk, and one output A (4-bit). The register can do four different operations depending on the value

  Elements of a data center besides

Research other elements of a data center besides the core elements discussed in this chapter, including environmental control parameters such as HVAC (heat, ventilation, and air-condition), power supplies, and security.

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