Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 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 [0, 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

Ask the user for the number - if number bet Ask the user for color - if color bet

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

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago