Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
"Kiddie Rides"
"Family Rides"
"Thrill Rides"
"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 or increment needsSafetyCheck by
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started