Question: Program Specification: Write a Java program that allows the user to play roulette. In our version of roulette, the roulette wheel has the following characteristics:

Program Specification:
Write a Java program that allows the user to play roulette. In our version of roulette, the roulette wheel
has the following characteristics:
Slots are numbered from 0 to 36
Even numbered slots (except 0) are colored Red
Odd numbered slots are colored Black
The 0 slot is colored Green
The user starts with 100 chips, and each round can place one the following two types of bets - or quit
(cash out):
Bet on a specific number [1,36](payout is 35:1)
Bet on either Red or Black color (payout is 1:1)
Cash out
Your program should behave as follows:
Display a welcome message
Repeatedly do the following:
Ask the user to choose a bet type (or cash out)
if number bet or color bet
If number bet : Ask the user for the number to bet on
If color bet : Ask the user for color to bet on
Ask the user to choose an amount to bet (between 1 chip and the total number of chips the
user currently has), and record the bet amount
Spin the wheel and report the number and color
Inform the use of their win/loss status, and updated the users chip total appropriately
Until the user chooses to cash out or has no more chips left to bet
Once the user chooses to cash out a final report is displayed indicating the users winnings or loses
(relative to their starting with 100 chips).
Rules and Requirements:
All user input must be validated

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!