The dice in a craps round is called the "come out roll"

Assignment Help Computer Engineering
Reference no: EM1329996

In the game of Craps, a "Pass Line" bet proceeds as follows. Using two six-sided dice, the first roll of the dice in a craps round is called the "Come Out Roll". The bet immediately wins when the come out roll is 7 or 11, and loses when the come out roll is 2, 3, or 12. If 4, 5, 6, 8, 9, or 10 is rolled on the come out roll, that number becomes "the point". The player keeps rolling the dice until either 7 or the point is rolled. If the point is rolled first, then the player wins the bet. If the player rolls a 7 first, then the player loses.

Write a Java program that plays the game of Craps using the rules stated above so that it simulates a game without human input. Instead of asking for a wager, the program should just calculate if the player would win or lose. The program should simulate rolling the two dice and calculate the sum. Add a loop so that the program plays 10,000 games. Add counters that count how many times the player wins, and how many times the player loses. At the end of the 10,000 games, compute the probability of winning, i.e. Wins / (Wins + Losses) and output this value. Over the long run, who is going to win the most games of Craps, you or the house?

Reference no: EM1329996

Questions Cloud

How would an increase in the present rate of oil affect : Explain how would an increase in the present rate of oil affect the time of development if the rate of price increase in the future remains at 2%.
Explaining the rule of law : What is the relationship between the 'Separation of Powers' doctrine and the 'Rule of Law'?
Employment business law for human resources : Arbitration Agreements and Employer/Employee Disputes - Employment Business Law for Human Resources
Construct a graph on a non straight line : Can you construct a graph on a non straight line?
The dice in a craps round is called the "come out roll" : In the game of Craps, a "Pass Line" bet proceeds as follows. Using two six-sided dice, the first roll of the dice in a craps round is called the "Come Out Roll". The bet immediately wins as the come out roll is 7 or 11, and loses when the come out..
Question of time value of money : Find out the value of share of firm's stock when the firm is expected to pay $2.80 per share dividend at the end of each year and annual discount rate is 7.5 percent?
Explain details regarding management information systems : Explain Details regarding Management Information Systems and understand how the business operates
What is the sustainability of kenya''s market : What is the sustainability of Kenya's market
Explain how might a high school students experience : Explain how might a high school student's experience with inflation differ from an employed urban adult.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Implementing the soubly linked list adt

Develop, implement, and test the soubly linked list ADT, utilizing the DLLNode objects as the nodes. Additionally to our standard list operations, your class must offer for backward iteration through the list.

  Illustrate a 4-d hypercube network

Illustrate a 4-D hypercube network

  Problem on boolean calculator

Problem on Boolean Calculator

  Related to super and sub class

Write down a class definition for subclass LawSchool which consists of: A (default) constructor which invokes the superclass constructor along with the value 3 (law school is typically a three year program).

  Explain the frame format of a typical ethernet packet

Explain how carrier sense multiple access with collision detection (CSMA/CD) works.

  A function to see if one list is a shallow copy of other

A function to see if one list is a shallow copy of other

  Speed routing protocol

Following question is related to SPEED routing protocol-Multiple speeds are computed in MAC layer. The forwarder with highest speed is selected on MAC layer feedback. This selection could not produce a shortest path.

  Problem on troubleshooting dns records

Problem on Troubleshooting DNS Records

  What is equation in java

What is equation in Java

  Define why it is suggested that for security reasons

Since many commercial APs have the SSID broadcast option enabled by default, so clients may easily detect the presence of an AP. APs are also configured as DHCPs and Firewalls.

  Multiplexer and decoder

A bus organized the CPU has 32 registers with 16 bits in each, an ALU and a destination decoder. Specify how many multiplexers are there within the bus, and specify the size of each multiplexer?

  Application showing sizes of two files and their ratio

Build a file which consists of your favourite movie quote. Make a use of a text editor like Notepad and save file as Quote.txt. Copy contents of the file and paste them into the word-processing program like Word. Save file as Quote.doc. Write down..

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