Question: IN JAVA **************************************************************************************************************************************************************************************************************** SAMPLE OUTPUT: Craps Game: Note: For this program a shell has not been provided to you. You need to read the assignment
IN JAVA




****************************************************************************************************************************************************************************************************************
SAMPLE OUTPUT:

Craps Game: Note: For this program a shell has not been provided to you. You need to read the assignment completely and make sure that you understand the rules of the game by reading about it online as well. Problem: In the game of craps, a pass line bet proceeds as follows. Two six-sided die are rolled: the first roll of the dice in a craps round is called the "come out roll." A come out roll of 7 or 11 automatically wins, and a come out roll of 2, 3, or 12 automatically loses. 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 a 7 is rolled first, then the player loses Write a program that simulates a game of craps using these rules without human input. Instead of asking for a wage, the program should calculate whether the player would win or lose. The program should simulate rolling 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 (wins/ (wins + losses)) and output this value Note: to simulate the dice rolling use the Random class to generate numbers between 1 and 6 inclusive Here is an example series: The shooter throws the dice on a come out roll, which starts a new series, and a 5 is rolled. (Recall that rolling a 7 or 11 would have been winners and 2, 3, or 12 would have been losers.) The shooter has established a point of 5 . The shooter throws the dice again and rolls an 8 Nothing happens and player rolls the dice again The shooter throws the dice again and rolls a 3. (Note that rolling a 2, 3, 11, or 12 after a point is established means nothing) The shooter throws the dice again and rolls a5 This is the shooter's point so this is a win and the series ends
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
