Question: Write a Java program to do the following: We need to print out with a System.out.println() statement which roller coaster a person can ride. Here

Write a Java program to do the following:

We need to print out with a System.out.println() statement which roller coaster a person can ride. Here are the requirements:

The program is to ask the user to input an age and a weight (in pounds) for the person about to ride the roller coaster. Extra credit if you do sophisticated error checking, like checking for negative numbers, or input that's not a number.

If a person is younger than or equal to 10 years old and weights less than 80 pounds print the following: This person needs to ride the black roller coaster. If a person is younger than or equal to 10 years old and weights between 80 and 200 pounds (including weighing exactly 80 or 200 pounds), print the following: This person needs to ride the green roller coaster. If a person is younger than or equal to 10 years old and weights more than 200 pounds, print the following: This person needs to ride the yellow roller coaster. If a person is younger than or equal to 20 years old but older than 10 and weights less than 80 pounds, print the following: This person needs to ride the silver roller coaster. If a person is younger than or equal to 20 years old but older than 10 and weights between 80 and 200 pounds (including weighting exactly 80 or 200 pounds), print This person needs to ride the red roller coaster. if a person is younger than or equal to 20 years old but older than 10 and weights more than 200 pounds, print: This person needs to ride the purple roller coaster. Everyone else rides the pink roller coaster, print: This person needs to ride the pink roller coaster

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!