People may enter a contest UNLESS they are less than 21 years old, make more
than $100,000, or live in Ohio.
The boolean expression is grouped so that it is
true when a person CAN enter the contest.
Answer:
!( age < 21 || pay > 100000 || home.equals("Ohio") )
End of the Chapter
You have reached the end this chapter. You may wish to review the following. Click on a subject that interests you to go to where it was discussed.
- The short-circuit AND operator
- Side effects.
- The non-short-circuit AND operator
- The short-circuit OR operator
- The non-short-circuit OR operator
- Associativity of &&
- Boolean expressions with mixed logical operators.
- precedence of logial operators.
- pure function.
- Subexpressions in a boolean expression.