Answer the given question with a proper explanation and step-by-step solution. On a roulette wheel, the pockets are numbered 0 through 36. Each pocket has a color: - Pocket 0 is green - From pocket 1 to 10, the odd pockets are red and the even pockets are black. - From pocket 11 to 18, the odd pockets are black and the even pockets are red. - From pocket 19 to 28, the odd pockets are red and the even pockets are black. - From pocket 29 to 36, the odd pockets are black and the even pockets are red. Write a program that: 1. Ask the user for the number of one of the pockets. 2. If the user entered a number between 0 and 36, it displays the color of the selected pocket. 3. If the user enters a number that is **not** between 0 and 36, the screen should display the message: "Error: the selection was incorrect.". **DO NOT** ask the user for the number again. The program should terminate with the error message displayed in this case
Answer the given question with a proper explanation and step-by-step solution.
On a roulette wheel, the pockets are numbered 0 through 36. Each pocket has a color: - Pocket 0 is green - From pocket 1 to 10, the odd pockets are red and the even pockets are black. - From pocket 11 to 18, the odd pockets are black and the even pockets are red. - From pocket 19 to 28, the odd pockets are red and the even pockets are black. - From pocket 29 to 36, the odd pockets are black and the even pockets are red. Write a program that: 1. Ask the user for the number of one of the pockets. 2. If the user entered a number between 0 and 36, it displays the color of the selected pocket. 3. If the user enters a number that is **not** between 0 and 36, the screen should display the message: "Error: the selection was incorrect.". **DO NOT** ask the user for the number again. The program should terminate with the error message displayed in this case.

Step by step
Solved in 4 steps with 4 images









