Question: What is wrong with the following code snippet that checks if a person is tall enough to ride the rollercoaster? int height = 4 8

What is wrong with the following code snippet that checks if a person is tall enough to ride the rollercoaster?
int height =48;
if(height <54)
{
boolean safe = false;
}
System.out.println("Is it safe to ride this rollercoaster? "+safe);
Nothing wrong
A variable name has a typo in it.
A variable is accessed outside of its scope.
Brackets are not matched up.

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!