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

  The sequential search algorithm to locate one of the values

It should call a module that uses the sequential search algorithm to locate one of the values. The module shuld keep a count of the number of comparisions it makes until it finds the value. Then the program should call another module that uses the..

  Write program to convert length in feet into centimeters

Write the program which prompts the user to enter the length in feet and inches and outputs equivalent length in centimeters.

  Write a program to model a simple calculator

Write a program to model a simple calculator. Each data line should consist of the next operation to be performed from the list below and the right operand.

  Design a system for the organization

explain the main systems in place, discuss the integration, and explain how the data collected by these systems helps the organization make decisions and carry out the strategic plan.

  You have been hired by a school district

You have been hired by a school district to write a program that will grade multiple choice exams and providea report listing the grade (numeric and letter) for each student, the problems missed for each student.

  Program to load the data creating a sorted linked list

A Fully Documented Program to load the data creating a sorted linked list. A Test Plan to show how the program runs and can be executed

  Hubspot: inbound marketing and web 2.0

Hubspot: Inbound Marketing and Web 2.0

  Creating loop to find number of items bought based on price

Make a block using a loop that will find the number of items that can be bought based on the price of the item and the total amount available to spend.

  Program to ask how many games are being purchased

Your program should ask the store clerk how many games are being purchased and calculate a total due (with 6% tax). The total number of games, the discount amount.

  Write program which asks user for the url of a pdf file

Write a program which asks the user for the URL of a PDF file, checks that the URL starts with "http://" and ends with "pdf" or "PDF", downloads it with wget, and displays it with display.

  Describe create table command

Find the patients who have made an appointment with a doctor who does not treat them.

  Write a program to calculate a persons net pay

Calculate a person's net pay after subtracting federal income tax. The program should ask the user to enter the person's name, social security number, gross pay, and the number of dependents.

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