Skip to content

Commit ad60e19

Browse files
committed
feat: Add height check logic for roller coaster eligibility
✅ Logic: - Checks if user's height is at least 1.5 meters - Grants or denies access based on condition. Signed-off-by: Somesh diwan <[email protected]>
1 parent 2ed48cc commit ad60e19

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
public class Practice2
2-
{
3-
public static void main(String[] args)
4-
{
1+
public class Practice2 {
2+
public static void main(String[] args) {
53
double height = 1.5; //in meters
64
System.out.println("To enter the roller coaster, you must be at least 1.5 meters tall.");
7-
if (/* Replace with the appropriate condition */)
5+
6+
if (height >= 1.5) {
87
System.out.println("You may proceed.");
9-
else
8+
} else {
109
System.out.println("You may not ride it.");
10+
}
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)