Comparing Boolean Expressions - AP Computer Science A
Card 1 of 30
Evaluate: true || (!false && false).
Evaluate: true || (!false && false).
Tap to reveal answer
true. true OR anything is always true.
true. true OR anything is always true.
← Didn't Know|Knew It →
What Boolean operator is represented by '||'?
What Boolean operator is represented by '||'?
Tap to reveal answer
Logical OR. Returns true when at least one operand is true.
Logical OR. Returns true when at least one operand is true.
← Didn't Know|Knew It →
What is the result of the expression: !true?
What is the result of the expression: !true?
Tap to reveal answer
false. NOT operator flips true to false.
false. NOT operator flips true to false.
← Didn't Know|Knew It →
What is the result of the expression: true || false?
What is the result of the expression: true || false?
Tap to reveal answer
true. OR returns true if at least one operand is true.
true. OR returns true if at least one operand is true.
← Didn't Know|Knew It →
What does the '!' operator do in a Boolean expression?
What does the '!' operator do in a Boolean expression?
Tap to reveal answer
Negates the Boolean value. The NOT operator flips true to false and vice versa.
Negates the Boolean value. The NOT operator flips true to false and vice versa.
← Didn't Know|Knew It →
What is the result of the expression: !false?
What is the result of the expression: !false?
Tap to reveal answer
true. NOT operator flips false to true.
true. NOT operator flips false to true.
← Didn't Know|Knew It →
What Boolean operator is represented by '&&'?
What Boolean operator is represented by '&&'?
Tap to reveal answer
Logical AND. Returns true only when both operands are true.
Logical AND. Returns true only when both operands are true.
← Didn't Know|Knew It →
What is the result of the expression: true && false?
What is the result of the expression: true && false?
Tap to reveal answer
false. AND requires both operands to be true.
false. AND requires both operands to be true.
← Didn't Know|Knew It →
Determine the result of: true || (false && true).
Determine the result of: true || (false && true).
Tap to reveal answer
true. true OR anything is always true.
true. true OR anything is always true.
← Didn't Know|Knew It →
Determine the result of: (true && false) || true.
Determine the result of: (true && false) || true.
Tap to reveal answer
true. (true && false) is false, but false || true is true.
true. (true && false) is false, but false || true is true.
← Didn't Know|Knew It →
Which expression is equivalent to !(a && b)?
Which expression is equivalent to !(a && b)?
Tap to reveal answer
!a || !b. De Morgan's Law: negate AND, flip to OR, negate operands.
!a || !b. De Morgan's Law: negate AND, flip to OR, negate operands.
← Didn't Know|Knew It →
Which expression is equivalent to !(a || b)?
Which expression is equivalent to !(a || b)?
Tap to reveal answer
!a && !b. De Morgan's Law: negate OR, flip to AND, negate operands.
!a && !b. De Morgan's Law: negate OR, flip to AND, negate operands.
← Didn't Know|Knew It →
Evaluate: false && (!false || true).
Evaluate: false && (!false || true).
Tap to reveal answer
false. false AND anything is always false.
false. false AND anything is always false.
← Didn't Know|Knew It →
Determine the result of: (true || false) && false.
Determine the result of: (true || false) && false.
Tap to reveal answer
false. (true || false) is true, but true && false is false.
false. (true || false) is true, but true && false is false.
← Didn't Know|Knew It →
Evaluate: true || (!false && false).
Evaluate: true || (!false && false).
Tap to reveal answer
true. true OR anything is always true.
true. true OR anything is always true.
← Didn't Know|Knew It →
What is the result of: (true && true) || false?
What is the result of: (true && true) || false?
Tap to reveal answer
true. (true && true) is true, and true OR false is true.
true. (true && true) is true, and true OR false is true.
← Didn't Know|Knew It →
Evaluate: !(false && (true || false)).
Evaluate: !(false && (true || false)).
Tap to reveal answer
true. (false && anything) is false, so !(false) is true.
true. (false && anything) is false, so !(false) is true.
← Didn't Know|Knew It →
Determine the result of: !(false || (true && true)).
Determine the result of: !(false || (true && true)).
Tap to reveal answer
false. (true && true) is true, (false || true) is true, !(true) is false.
false. (true && true) is true, (false || true) is true, !(true) is false.
← Didn't Know|Knew It →
Determine the result of: !(true && (false || true)).
Determine the result of: !(true && (false || true)).
Tap to reveal answer
false. Inner expression is true, so !(true) is false.
false. Inner expression is true, so !(true) is false.
← Didn't Know|Knew It →
What is the precedence order of the operators: &&, ||, ! ?
What is the precedence order of the operators: &&, ||, ! ?
Tap to reveal answer
!, &&, ||. NOT has highest precedence, then AND, then OR.
!, &&, ||. NOT has highest precedence, then AND, then OR.
← Didn't Know|Knew It →
Determine the result of: (true || false) && !false.
Determine the result of: (true || false) && !false.
Tap to reveal answer
true. (true || false) is true, and true && true is true.
true. (true || false) is true, and true && true is true.
← Didn't Know|Knew It →
Determine the result of: true && (false || true).
Determine the result of: true && (false || true).
Tap to reveal answer
true. Parentheses first: (false || true) is true, then true && true.
true. Parentheses first: (false || true) is true, then true && true.
← Didn't Know|Knew It →
Evaluate: (false && false) || (true && false).
Evaluate: (false && false) || (true && false).
Tap to reveal answer
false. Both AND operations are false, so false OR false is false.
false. Both AND operations are false, so false OR false is false.
← Didn't Know|Knew It →
Determine the result of: !(false || (true && true)).
Determine the result of: !(false || (true && true)).
Tap to reveal answer
false. (true && true) is true, (false || true) is true, !(true) is false.
false. (true && true) is true, (false || true) is true, !(true) is false.
← Didn't Know|Knew It →
What is the result of the expression: !true?
What is the result of the expression: !true?
Tap to reveal answer
false. NOT operator flips true to false.
false. NOT operator flips true to false.
← Didn't Know|Knew It →
Evaluate the expression: false || !true.
Evaluate the expression: false || !true.
Tap to reveal answer
false. false OR !true becomes false OR false equals false.
false. false OR !true becomes false OR false equals false.
← Didn't Know|Knew It →
What Boolean operator is represented by '&&'?
What Boolean operator is represented by '&&'?
Tap to reveal answer
Logical AND. Returns true only when both operands are true.
Logical AND. Returns true only when both operands are true.
← Didn't Know|Knew It →
What does the '!' operator do in a Boolean expression?
What does the '!' operator do in a Boolean expression?
Tap to reveal answer
Negates the Boolean value. The NOT operator flips true to false and vice versa.
Negates the Boolean value. The NOT operator flips true to false and vice versa.
← Didn't Know|Knew It →
What is the result of the expression: true && false?
What is the result of the expression: true && false?
Tap to reveal answer
false. AND requires both operands to be true.
false. AND requires both operands to be true.
← Didn't Know|Knew It →
Evaluate: !(false && (true || false)).
Evaluate: !(false && (true || false)).
Tap to reveal answer
true. (false && anything) is false, so !(false) is true.
true. (false && anything) is false, so !(false) is true.
← Didn't Know|Knew It →