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

  Create a class-how to cash goods-give change to customers

Write class called Cashier that directs a cashier how to cash goods and give change to customers. Typical cashier operations are as follows.

  Design a grade average program by using raptor which will

design a grade average program using raptor that will produce the numerical grade average of test scores input by a

  Write program to allot seats on each flight of airline-s

Program the new system you are to write program to allot seats on each flight of airline's only plane(capacity: 10 seats)

  Write program for user to perform arithmetic operations

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0.

  A number type or boolean

In Java, a number type or Boolean (There are 8: long, short, float, char, int, boolean, byte, bit, double)

  Prompt the user to enter the price for apple

C program: Grocery Checkout total. Implement the pseudocode developed in Week 2. Insert meaningful comments at least once for every few lines of the program.

  Show the graphics simulation of drinks machine

When a coin is clicked on with the mouse it is placed into the slot, it then operates the coin sensor IP0. This should operate OP0 (coin hold solenoid), which will hold the coin in place. At this point either a drink is selected or the coin rejected.

  Write program to allow two users to play tic-tac-toe

Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O.

  Write a program that creates a file called grades.txt

Write a program that creates a file called "grades.txt" with 1000 lines. Each line in the "grades.txt" file will consist of a student's first name, last name, graduating year(2013,2014,2015), and grade.

  Find the sum of the cost line column

Write the SQL to count how many authors have a last name that starts with S.

  Script that is executed in an active server page

The contents of a form on a client can be sent to a server pageby using

  Write the program which simulates shopping

Write the program which simulates shopping. Program must have a loop which continues as long as user wants to shop. Each time through loop read in name, price, and quantity of the item.

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