Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programming language, starting out with C++. Looping Constructs Write a program to simulate the casino game craps. It should execute N number of games

C++ programming language, starting out with C++.

Looping Constructs

Write a program to simulate the casino game "craps". It should execute N number of games so that you can compute the probability(%) of the "player" winning and the "house" winning.

Probability(%) of the "player" winning = PlayerWins / N * 100.

Probability(%) of the "house" winning = HouseWins / N * 100.

The rules are:

Player rolls two dice. When the sum is 7 or 11 on first throw, player wins. Game over. When the sum is 2, 3, or 12 on first throw, "house" wins. Game over.

When the sum is 4,5,6,8,9, or 10 on first throw, that sum becomes the player's "point". Now, to win the player must continue rolling the dice until he matches "point"; however should he roll a 7 then the "house" wins. That concludes the game.

Run six(6) Simulations to complete the Table:

Number of Games %Prob(PlayerWins) %Prob(HouseWins) --------------------------------------------------------- 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

PostgreSQL 10 High Performance Expert Techniques For Query Optimization High Availability And Efficient Database Maintenance

Authors: Ibrar Ahmed ,Gregory Smith ,Enrico Pirozzi

3rd Edition

1788474481, 978-1788474481

More Books

Students also viewed these Databases questions

Question

12.6 Prediction

Answered: 1 week ago