Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!