Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10000 games of craps. Game of Craps. In the game of craps, two six-sided dice are rolled. - A roll of 7 or 11 immediately

10000 games of craps. Game of Craps. In the game of craps, two six-sided dice are rolled. - A roll of 7 or 11 immediately wins, and a roll of 2, 3, or 12 immediately loses. - If any other number is rolled, that number becomes The Point. The player then keeps rolling the dice until either 7 or The Point is rolled. If the point is rolled, the player wins, but if 7 is rolled, the player loses. Please design and implement two Java class named Craps.java and Main.java. 1. In Craps.java, provide a roll() method that simulates a roll of a single die. Also in Craps.java, provide a playCraps method that plays one game and returns a boolean value true for Win or false for Lose. 2. In Main.java, provide the main() method to play 10000 games, count how many times the player wins and loses, and output the wins and losses and the probability of winning (wins / (wins + losses)). Format the output neatly, showing the times of wins and losses, plus the probability as a percentage. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions