Question: Create a python program that prompts the user for input, simulates the outcome of a dice roll ( 2 6 - face die ) ,
Create a python program that prompts the user for input, simulates the outcome of a dice roll face die applies a set of rules, calculates and displays the results to the user. The user will be asked if they want to roll again or stop play.
Business Rules
Craps is a betting game based on the roll of dice. The dice are made up of two game pieces. In this miniproject, you will create a program to play craps by simulating the roll of two sided dies and evaluating the results. The result is based on the total of the dice. For example, if the roll is a on die one and on die two, the result win lose or roll again is based on the total of The rules are as follows:
Roll One
Total of the first rollResult or You Win or You LoseRoll Again
Roll Two: If on the first roll, the shooter rolls a combined or that number becomes the "point" and is the target for all subsequent rolls. To determine a winner, the shooter continues rolling until either the "point" is rolled again and you win or a is rolled and you lose.
Total of the nd and subsequent rollsResultYou LosePoint sum of roll one You WinAny other numberRoll Again
The program should:
Ask the user how much they want to bet and save this value to the variable BetAmount.
Simulate the first roll of the dice using the import Random.
Display the result of the first roll and, based on the roll, display one of the following:
"You rolled a DiceTotal and won $ BetAmount Do you want to play again yn
"You rolled a DiceTotal and lost $ BetAmount Do you want to play again yn
"You rolled a DiceTotal Press the Enter key to roll again
If the user was prompted to roll again and rolls a display:
"You rolled a DiceTotal and lost $ BetAmount Do you want to play again yn
If the user was prompted to roll again and rolls the "point", display:
"You rolled a DiceTotal and won $ BetAmount Do you want to play again yn
Continue looping the program until the user types n when asked if they want to play again. Keep track of the number of games played and amount of money won and lost and display the results to the user when they stop playing such as:
"You played NumGames games and WonOrLost a total of $ AmountWonOrLost
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
