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 (26-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 mini-project, you will create a program to play craps by simulating the roll of two 6-sided dies and evaluating the results. The result is based on the total of the dice. For example, if the roll is a 2 on die one and 3 on die two, the result (win, lose or roll again) is based on the total of 5. The rules are as follows:
Roll One
Total of the first rollResult7 or 11You Win2,3, or 12You Lose4,5,6,8,9,10Roll Again
Roll Two: If on the first roll, the shooter rolls a combined 4,5,6,8,9, or 10, 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 7 is rolled and you lose.
Total of the 2nd and subsequent rollsResult7You LosePoint (sum of roll one =4,5,6,8,9,10)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 (y/n)?"
"You rolled a "+ DiceTotal +" and lost $"+ BetAmount +". Do you want to play again (y/n)?"
"You rolled a "+ DiceTotal "+". Press the Enter key to roll again
If the user was prompted to roll again and rolls a 7, display:
"You rolled a "+ DiceTotal +" and lost $"+ BetAmount +". Do you want to play again (y/n)?"
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 (y/n)?"
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 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 Programming Questions!