Question: 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

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 GroupExpected Output1"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.
1
If choice is b, print "Brave choice, the journey begins!"
If choice is c, print "A cautious move, let's see where this leads."
For any other value of choice, print "Unrecognized option, choose again."
Note: You will need to write the switch case statement and display the correct output for each category.
1
Write a switch statement that tests the value of the char variable choice and performs the following actions based on the player's decision:
If choice is a, print "Adventure awaits!"
If choice is b, print "Brave choice, the journey begins!"
If choice is c, print "A cautious move, let's see where this leads."
For any other value of choice, print "Unrecognized option, choose again."
Note: You will need to write the switch case statement and display the correct output for each category.
Assume there are two integer variables, scoreChallenge1 and scoreChallenge2, each representing the player's score in the respective challenges. Write an expression using the conditional operator (? :) that compares the values of scoreChallenge1 and scoreChallenge2 and results in the higher of the two scores. Assign the greater value to the variable result, which you can assume has already been declared.
If scoreChallenge1 and scoreChallenge2 are equal, assign the value of either variable to the result variable.
1

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 Programming Questions!