Question: Goal: Write a switch . . . case statement. Assignment:You're programming a system for a theme park. This system categorizes guests based on their age

Goal: Write a switch ... case statement.
Assignment:You're programming a system for a theme park. This system categorizes guests based on their age to determine the rides they can access. Each age group has a specific code and corresponding ride category.
Write some code that reads from the keyboard an int representing the age group. Use a switch statement that prints out the appropriate ride category from the list below based on the age group:
Age Group Expected Output
1 "Kiddie Rides"
2 "Family Rides"
3 "Thrill Rides"
4 "Extreme Rides"
If the value is none of the above, print "Unknown Category". Assume also that an int variable needsSafetyCheck has been declared and assigned. If the age group is either 3 or 4, increment needsSafetyCheck by 1.
Note: You are not allowed to use if statements or conditional operators. You will need to write the switch case statement and display the correct output for each category.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!