Question: Write a program that plays a simplified version of roulette. You start out with $ 1 0 0 . 0 0 ( virtual dollars, of

Write a program that plays a simplified version of roulette. You start out with $100.00(virtual dollars, of course!). The program repeatedly asks you if you want to bet on Odd, Even, Number, Red, Black, Quit, or get Help.
The player may enter 0, E, N, R, B, Q or H, in either uppercase or lowercase. If the player enters an invalid character, you have to give an error message. If you entered H, the program will display the instructions for you.
If you entered a bet type (E, O, N,R,B) the program will ask you how much you want to bet (integers only). Your bet must be greater than 5($5 minimum bet) and less than or equal to the amount of money you have remaining. The program will continue to prompt you for a bet until you give a valid bet. If you entered a bet type of N, the program will ask you for the number (0-36) that you wish to bet on.
The program will then spin the wheel and generate and display a number from 0 to 36 inclusive. If you guessed correctly, you win the amount of your bet. If you guessed wrong, you lose the the amount of your bet. The single number bet (N) is specialit doesnt count as even, odd, red, or back, so if the number you chose comes up, you win 35 times the amount of your bet.
In roulette,
the following numbers are red: 1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36
the following numbers are black: 2,4,6,8,10,11,13,15,17,20,22,24,26,28,29,31,33,35
After each bet, the program tells you how much money you have left and congratulates you if you win or consoles you if you lost.
If you lose all your money, the program stops; otherwise, it asks for a new bet.
When you decide to quit (or you run out of money), your program will show the number of times you won, the number of times you lost, and the amount of money you have left.
Additional Requirements
When the program is first run, it should display help to the user as well as the starting bank roll about.
Your program must be decomposed into functions and files. You should not have more than one function that does the same thing. For example, there should be individual functions for each of the following tasks:
play rouletteget betspin wheeldisplay help

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!