How often a player would win if they rolled the dice

Assignment Help Programming Languages
Reference no: EM131264397

The game of Craps is a dice game that involves rolling a pair of dice. At the start of each turn if the player rolls a 7, or 11 they win.

Write a program that simulates how often a player would win if they rolled the dice 100 times.

The program will output a message such as "The player rolled 14 sevens and 5 elevens for a total of 19 wins out of 100."

The program will ask the user if they wish to run another simulation or quit.

Possible Program structure

Create a random number for each dice using either the API Random class or the Math classes' random method.

Create a loop that will loop 100 times.

Within the loop

Store the random number output

if it is a seven or eleven increment the value of the appropriate variable.

Print out the message stating the number of sevens and elevens.

Use the appropriate to type of loop to prompt the user if they like to try again or quit.

Reference no: EM131264397

Questions Cloud

What is daphne and david adjusted gross income : What is Daphne's and David's Adjusted Gross Income (AGI) and Taxable Income for 2015? What is Daphne's and David's marginal tax rate? Their effective tax rate (using AGI)
Implement a class called fibonacci : Implement a class called Fibonacci. This class should provide a single class method (static) with the following signature: double Fibonacci::getNthFibonacciRecursively(int n)
Find the largest allowable value of t : The cylindrical tank of 10-in. diameter is fabricated from 1/4-in. plate. The tank is subjected to an internal pressure of 400 psi and a torque T. Find the largest allowable value of T according to the maximum distortion energy theory. Use σyp = 3..
Demonstrate your learning of marketing using an organisation : In light of this your task is to write a 3000-word magazine style article that explains how an organisation you have selected has utilised a Blue Ocean Strategy and some of the components of The Circle of Satisfaction to become successful.
How often a player would win if they rolled the dice : Write a program that simulates how often a player would win if they rolled the dice 100 times.The program will output a message such as "The player rolled 14 sevens and 5 elevens for a total of 19 wins out of 100."
Find the largest axial load p that can be applied : Use the maximum shear stress theory to find the largest axial load P that can be applied in addition to the pressure without causing yielding.
Describe or list any false positive information : Describe or list any false positive information. Discuss potential safeguards and remediation actions that could be implemented for each finding to reduce the risk.
What is probability that the nurse forgot to give the pill : If he does not get the pill, the probability that he will die is ?. Mr. Brown died. What is the probability that the nurse forgot to give Mr. Brown the pill?
What is importance of developing computer facility controls : What is the importance of developing computer facility controls? Explain in your response the risk of an organization failure to develop computer facility controls.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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