Problem

Roulette Wheel Colors On a roulette wheel, the pockets are numbered from 0 to 36....

Roulette Wheel Colors

On a roulette wheel, the pockets are numbered from 0 to 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.

Write a class named The class’s constructor should accept a pocket number. The class should have a method named that returns the pocket’s color, as a string.

Demonstrate the class in a program that asks the user to enter a pocket number, and displays whether the pocket is green, red, or black. The program should display an error message if the user enters a number that is outside the range of 0 through 36.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT