Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Python) Simplified Roulette You are visiting Las Vegas. You decide that you will play a simplified version of Roulette. The game is played this way:

(Python) Simplified Roulette

You are visiting Las Vegas. You decide that you will play a simplified version of Roulette.

The game is played this way:

On a roulette wheel the pockets are numbered from 0 - 36. The colors of the pockets are as follows:

Pocket 0 is green

For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black

For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red

For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black

For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red

You select a pocket number and place your bet. The wheel is spun and a ball lands in a pocket.

If you bet on pocket 0 and the ball lands that pocket you receive 10 times the amount you bet (if you bet $1 you receive that $1 plus $9)

If the ball lands in the red or black pocket you bet on you receive triple the amount you bet (if you bet $1 you receive that $1 plus $2 ).

If the ball lands in a red or black pocket that is the same color as the pocket you selected you double your money (if you bet $1 you receive that $1 plus $1)

If the ball lands in a red or black pocket that is a different color than the red or black pocket you selected you lose your bet

You start with $500

You are to write a program that will accept from the user the pocket number they select and the amount of their bet. Your program must trap (using a while loop) the user to enter valid information (i.e. a pocket number 0 - 36 and a bet >= 0). Simulate the landing of the ball in a pocket through the random generation of a number 0 - 36, inclusive). Your program will simulate the play of the game as described above.

Play a game until the user has no money left (using a while loop).

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions