NOTE---   this is the 2nd time posting this program on here. The first didn't work.   Overview Your club is running an online casino night to raise money for a local charity. You have been asked to create a program to simulate a game of craps. Implementation Create a python program that prompts the user for input, simulates the outcome of a dice roll (2 6-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: 1. Roll One Total Of The First Roll Result   7 or 11 You Win   2, 3, or 12 You Lose   4, 5, 6, 8, 9, 10 Roll Again 2. 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 rolls Result   7 You Lose Point (sum of roll one = 4, 5, 6, 8, 9, 10) You Win Any other number Roll 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       4. 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)?     5. 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              stopplaying such as:                "You played " + NumGames + " games and " + WonOrLost + " a total of $" + AmountWonOrLost     6. If you have a running program, test your program by creating at least 5 program runs. Each run should                    capture the program display similar to this craps result display.      Please  Answer this Question after program is done 1. Draw a diagram or pseudocode of the solution. 2. Does the program runs as expected and why? 3. If you have a running program, test your program by creating at least 5 program runs. Each run should capture the program display similar to this craps result display.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

NOTE---   this is the 2nd time posting this program on here. The first didn't work.  

Overview

Your club is running an online casino night to raise money for a local charity. You have been asked to create a program to simulate a game of craps.

Implementation

Create a python program that prompts the user for input, simulates the outcome of a dice roll (2 6-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:

1. Roll One

Total Of The First Roll Result
  7 or 11 You Win
  2, 3, or 12 You Lose
  4, 5, 6, 8, 9, 10 Roll Again

2. 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 rolls Result
  7 You Lose
Point (sum of roll one = 4, 5, 6, 8, 9, 10) You Win
Any other number Roll Again

 

The program should:

  1. Ask the user how much they want to bet and save this value to the variable BetAmount.
  2. Simulate the first roll of the dice using the import Random.
  3. 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

      4. 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)?

    5. 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              stopplaying such as:

               "You played " + NumGames + " games and " + WonOrLost + " a total of $" + AmountWonOrLost

    6. If you have a running program, test your program by creating at least 5 program runs. Each run should                    capture the program display similar to this craps result display.

 

   Please  Answer this Question after program is done

1. Draw a diagram or pseudocode of the solution.

2. Does the program runs as expected and why?

3. If you have a running program, test your program by creating at least 5 program runs. Each run should capture the program display similar to this craps result display.

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY