S3U

Science / Programming basics / Grade 9 / sc970

Programming Basics: Combine Boolean Conditions

Build truth tables rather than guessing how AND, OR and NOT behave.

All worksheets
5 questions0m 0s
Learn the skill

A Boolean value is true or false. AND is true only when both inputs are true. OR is inclusive: at least one input true is enough, including both. NOT reverses a Boolean value. Parentheses make grouping explicit.

Worked example

For a = true and b = false, a AND b is false, a OR b is true, and NOT b is true. In this worksheet inputs are already Booleans; no automatic type conversion is assumed.

For the four Boolean input pairs, AND is true only when both inputs are true. Inclusive OR is true for every pair except false and false.
For the four Boolean input pairs, AND is true only when both inputs are true. Inclusive OR is true for every pair except false and false.
Question 1 With a = true and b = false, what is a AND b?
Question 2 With a = true and b = false, what is a OR b?
Question 3 If both inputs are true, is inclusive OR true?
Question 4 With b = false, what is NOT b?
Question 5 Which expression matches NOT (a AND b) for all Boolean inputs?