Boolean Expressions - AP Computer Science A
- Evaluate the expression: !(true && false) || false.
- true. NOT inverts false to true, OR with false stays true.
- What does the expression (false && !false) evaluate to?
- false. AND with false always produces false.
- What is a compound Boolean expression?
- An expression using multiple Boolean operators. Combines multiple boolean operations together.
- What is the result of !(true && true)?
- false. NOT inverts the true result of AND to false.
- Evaluate: !(false || false) && true.
- true. Parentheses force NOT evaluation before AND.
- What is the result of true && false?
- false. AND requires both operands to be true.
- What is the value of !true?
- false. NOT operator flips the boolean value.
- What is a short-circuit evaluation in Booleans?
- Evaluation stops as soon as result is determined. Prevents unnecessary computation for efficiency.
- Find the result of true || true && false.
- true. AND has higher precedence than OR.
- Evaluate the expression: true && (false || true).
- true. Parentheses force OR evaluation before AND.
- Find the result of !(false || false).
- true. NOT inverts the false result of OR to true.
- What is a truth table?
- A table showing all possible truth values of a Boolean expression. Lists all input combinations and their outputs.
- Identify the result of !(false || true).
- false. NOT inverts the true result of OR to false.
- What is the result of true || false?
- true. OR returns true when at least one operand is true.
- What is the result of !false && true?
- true. NOT false is true, AND with true gives true.
- Evaluate the expression: !(true || false).
- false. NOT inverts the true result of OR to false.
- What does the expression (true && !false) evaluate to?
- true. AND of true and NOT false equals true.
- Evaluate: true || (false && true).
- true. OR short-circuits when first operand is true.
- What is the result of !(true && false)?
- true. NOT inverts the false result of AND to true.
- What is De Morgan's Law for !(A && B)?
- !A || !B. Distributes NOT over AND to become OR of NOTs.
- What is the result of false && false?
- false. AND requires both operands to be true.
- What is the precedence order of logical operators?
- ! > && > ||. NOT has highest precedence, then AND, then OR.
- What is the result of false || true?
- true. OR returns true when at least one operand is true.
- Identify the result of true && (true || false).
- true. Parentheses force OR evaluation before AND.
- Evaluate: !(false && true).
- true. NOT inverts the false result of AND to true.
- What does the || operator do?
- Returns true if either operand is true. Inclusive OR operation for logical disjunction.
- Identify the logical operator for 'or'.
- ||. Double pipe symbol represents logical OR operation.
- What does the && operator do?
- Returns true if both operands are true. Logical conjunction requires both conditions.
- What is the result of true || false && false?
- true. AND has higher precedence than OR.
- Evaluate the expression: false || false.
- false. OR requires at least one operand to be true.
- What is the value of false && true || true?
- true. OR has lower precedence than AND.
- What is a Boolean expression?
- An expression that evaluates to true or false. Boolean data type has only two possible values.
- What is the result of !(true || true)?
- false. NOT inverts the true result of OR to false.
- What is the value of !true && !false?
- false. NOT true is false, NOT false is true, AND gives false.
- Evaluate the logic: !true && true.
- false. NOT true is false, AND with true gives false.
- What is the result of !true || false?
- false. NOT true is false, then OR with false stays false.
- What is the result of !false || false?
- true. NOT false is true, then OR with false gives true.
- Identify the result of true && true.
- true. AND requires both operands to be true.