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

  Converting the sum of elements of array into octal format

Provided an array of ints named x and an int variable named total that has already been declared, write down some code which places the sum of all the elements of the array x into total.

  How to provide a cost-effective means of protection

What will be an appropiate outlined for this and provide a cost-effective means of protection.

  Analyzing the database schema

OrderLine (OrderNum, PartNum, NumOrdered, QuotedPrice), Part (PartNum, Description, OnHand, Class, Warehouse, Price), On the basis of code above, list the number and name of all the customers.

  Compute the average number of machine cycles per instruction

assume this system requires an extra 16 machine cycles to retrieve an operand from memory. It has to go to memory 30% of the time. What is the average number of machine cycles per instruction for this microprocessor, including its memory fetch ins..

  Translate following c++ program to pep/8 assembly language

Translate following C++ program to Pep/8 assembly language

  Explain the method to find cost of sorting the relation

Explain the method to find cost of sorting the relation In each case, how many combine passes are required?

  Osi layered structure and different protocols

List and discuss major de-merits of the layered approach to protocols in scholarly detail.Explain why data network communication and distributed applications.

  Developing the java servlet

Provide the Java servlet which utilizes the doGet in order to return the markup document which offers your name.

  What is the largest positive number

What is the largest positive number one can repent in an 8-bit 2's complement code ? write your result in binary and decimal.

  How to find the number of characters in a string

How to find the number of characters in a string

  Consider an adt called squarematrix

Consider an ADT called 'SquareMatrix'

  Create a simplify credit card transaction management program

Create a simplify credit card transaction management program.

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