Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Craps is a dice game played with two 6 sided dice. Play the demo to see how it works. The rules of the game of

Craps is a dice game played with two 6 sided dice. Play the demo to see how it works.

The rules of the game of Craps are as follows:

You roll two dice. On the first roll of a game, if the sum of the dice is:

  • 2, 3 or 12 you lose
  • 7 or 11 you win

If you roll any other sum this is called your goal. Store this value and then keep rolling.

On subsequent rolls if the sum is:

  • yourgoalagain you win
  • 7 you lose

Keep rolling until you get your goal or a 7.

You will write program that will play a game of crap. The basic gameplay can only use four variables. You may use two to four variables for the betting aspect of the game.

At the beginning of the game, the user will start with $100. You will allow the user to bet any whole number that is less than or equal to the amount of money they currently have. You must check the input. If the input is negative the game ends. If the input is not an integer or bigger than the allowed amount, they must try again.

If the user wins, add the amount they bet to their original total. If the user loses, subtract the bet from their original total. Once the user has less than or equal to $0 remaining, they can no longer play (game ends).

I'm done the main part I just don't understand how to do the betting part of the game. Pleas help

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

=+1 To w hat kinds of purposes do you think the H all might be put?

Answered: 1 week ago