Switch Practice
Video Summary: https://youtu.be/K6sqnxdK-b4
Consider this program that rolls a random number between 1 and 6:
Using a switch statement, evaluate the available rolls as follows:
- If the case is 1 or 2, tell the player it was a bad roll
- If the case is 3, tell the player it was a medium roll
- If the case is 4 or 5, tell the player it was a good roll
- If the case is 6, tell the player it was the best roll
Since 1-2 and 4-5 have the same message, you should only need one cout for both options, with a total of 4, if you do your switch correctly. When you are finished, your output might look like this:
The dice roll is: 4
A good roll
A good roll