You are on page 1of 1

Lab 


 
In this lab you will be creating another java program that will test what you have learned about 
conditionals in this chapter.  Your program will simulate a carnival worker whose job it is to 
check the heights of riders for a rollercoaster.  Your program should first ask the user for their 
height in inches.  If they are under 60 inches(5ft) it should print out a message saying something 
like “Sorry, you are too short for this ride.”  If the rider is between 60 inches and 78 inches, your 
program should print out a message that says “You can safely ride this roller coaster, have fun!” 
Finally, if the rider is over 78 inches (6’6”) it should print out a message saying “Sorry, you are 
too tall to safely ride this rollercoaster.”  Your program should continue running, asking rider 
after rider what their height is, until the user types in an ending command of “0”.  If you have 
successfully completed this lab, your program's output should look something like the 
screenshot below.  

 
Tips: 
 
­You will need to use a Scanner to get input from the user. 
 
­Don’t forget to check for missed semicolons, brackets, and quotation marks. 
 
­Don’t worry if you try and still can’t find your error, you can watch the Lab 4 Solution video for a 
step by step walk through of a possible solution. 
 
Good Luck! 

You might also like