Question: Hey! I need help with (Code HS: 2.14.5 Amusement Park) public class Amusement Park extends Console Program { } int AGE LIMIT = 12; int
Hey!
I need help with (Code HS: 2.14.5 Amusement Park)


public class Amusement Park extends Console Program { } int AGE LIMIT = 12; int HEIGHT_LIMIT = 48; public void run() { int age read Int("Enter your age: "); int height = readInt("Enter your height in inches: "); boolean oldEnough age >= AGE_LIMIT; boolean tallEnough = height >= HEIGHT_LIMIT; // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannotRide = (oldEnough && tallEnough); if(cannotRide) { } else { } System.out.println("You may not ride the rollercoasters."); System.out.println ("You may ride the rollercoasters!"); boolean canSwim = readBoolean("Can you swim? "); boolean hasLifeJacket = readBoolean ("Do you have a life jacket? "); // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannot Swim !(canSwim || hasLifeJacket); if (cannotSwim) { } System.out.println("You may not swim in the pool."); } else { System.out.println("You may swim in the pool!");
Step by Step Solution
3.48 Rating (161 Votes )
There are 3 Steps involved in it
Here are the modified expressions using De Morgans Laws boolean cannotRide oldEnough tallEnough bool... View full answer
Get step-by-step solutions from verified subject matter experts
