Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now lets get on with the next Java practice assignment! If youre not familiar with the game of roulette, its fairly simple to understand. Basically

Now lets get on with the next Java practice assignment! If youre not familiar with the game of roulette, its fairly simple to understand. Basically its a game of selecting a random number between 1 and 36; this is done by spinning a roulette wheel while a ball bounces around before finally landing on one number. The numbers 1 through 36 have alternating colors (black and red), and this allows for certain betting to occur.

Before each spin of the roulette wheel, you are allowed to bet on a wide variety of things, but for this assignment you only need to concern yourself with the fact that you can bet on either black or red.

If you bet on red, and the roulette ball lands on red, then you win twice the amount that you bet (eg. if you bet $10 on red, and the ball lands on red, you will win $20)! If you bet on red, and the ball lands on black, then you lose your entire bet.

Note: There are also two green numbers (0 and 00), if the ball lands on one of these two numbers, then you will lose your bet regardless on which color (red or black) you had bet on.

Requirements:

Here are the basic aspects youll need to implement:

1.Roulette Wheel (for spinning)

2.Roulette Number (represents a number with a color)

3.Random Number Generator (used to generate a random number from 1 to 38; includes values for 0 and 00)

4.You may want to implement an Enum to represent the Colors (up to you)

5.Test class or Runnable class

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

More Books

Students also viewed these Databases questions