---------------------------- //!(a AND b) same as (!a OR !b) if (10 < x AND x < 20) { print("between") } else { print("outside") } if (!(10 < x) OR !(x < 20)) { print("outside") } else { print("between") } ---------------------------- //!(a OR b) same as (!a AND !b) if (x < 10 OR 20 < x) { print("outside") } else { print( "between") } if (!(x < 10) AND !(20 < x)) { print( "between") } else { print( "outside") } ---------------------------- // items under 6 inches and no heavier than ten pounds double inches = prompt("What size?") double weight = prompt( "What weight?") if (inches < 6 AND weight <= 10) { print( "allowed") } //opposite //(!(inches <6) OR !(weight <= 10)) if (inches >= 6 OR weight >10) { print( "not allowed") } ---------------------------- // dogs must be poodles or beagles string dogtype = prompt( "What type of dog?") if (dogtype == "poodle" OR dogtype == "beagle") { print( "allowed") } // opposite //(!(dogtype == "poodle") AND !(dogtype == "beagle")) if (dogtype != "poodle" AND dogtype != "beagle") { print( "not allowed") } ---------------------------- // destinations in MD cost $100, destinations in PA cost $200, $250 for VA, $150 for DE, otherwise $300 string state = prompt( "In what state is the destination?") double cost = 0; case state { "MD": cost = 100 "PA": cost = 200 "VA": cost = 250 "DE": cost = 150 default: cost = 300 } print( "Your cost is " + cost)