Boolean Expressions - AP Computer Science A

  1. Evaluate the expression: !(true && false) || false.
    true. NOT inverts false to true, OR with false stays true.
  2. What does the expression (false && !false) evaluate to?
    false. AND with false always produces false.
  3. What is a compound Boolean expression?
    An expression using multiple Boolean operators. Combines multiple boolean operations together.
  4. What is the result of !(true && true)?
    false. NOT inverts the true result of AND to false.
  5. Evaluate: !(false || false) && true.
    true. Parentheses force NOT evaluation before AND.
  6. What is the result of true && false?
    false. AND requires both operands to be true.
  7. What is the value of !true?
    false. NOT operator flips the boolean value.
  8. What is a short-circuit evaluation in Booleans?
    Evaluation stops as soon as result is determined. Prevents unnecessary computation for efficiency.
  9. Find the result of true || true && false.
    true. AND has higher precedence than OR.
  10. Evaluate the expression: true && (false || true).
    true. Parentheses force OR evaluation before AND.
  11. Find the result of !(false || false).
    true. NOT inverts the false result of OR to true.
  12. What is a truth table?
    A table showing all possible truth values of a Boolean expression. Lists all input combinations and their outputs.
  13. Identify the result of !(false || true).
    false. NOT inverts the true result of OR to false.
  14. What is the result of true || false?
    true. OR returns true when at least one operand is true.
  15. What is the result of !false && true?
    true. NOT false is true, AND with true gives true.
  16. Evaluate the expression: !(true || false).
    false. NOT inverts the true result of OR to false.
  17. What does the expression (true && !false) evaluate to?
    true. AND of true and NOT false equals true.
  18. Evaluate: true || (false && true).
    true. OR short-circuits when first operand is true.
  19. What is the result of !(true && false)?
    true. NOT inverts the false result of AND to true.
  20. What is De Morgan's Law for !(A && B)?
    !A || !B. Distributes NOT over AND to become OR of NOTs.
  21. What is the result of false && false?
    false. AND requires both operands to be true.
  22. What is the precedence order of logical operators?
    ! > && > ||. NOT has highest precedence, then AND, then OR.
  23. What is the result of false || true?
    true. OR returns true when at least one operand is true.
  24. Identify the result of true && (true || false).
    true. Parentheses force OR evaluation before AND.
  25. Evaluate: !(false && true).
    true. NOT inverts the false result of AND to true.
  26. What does the || operator do?
    Returns true if either operand is true. Inclusive OR operation for logical disjunction.
  27. Identify the logical operator for 'or'.
    ||. Double pipe symbol represents logical OR operation.
  28. What does the && operator do?
    Returns true if both operands are true. Logical conjunction requires both conditions.
  29. What is the result of true || false && false?
    true. AND has higher precedence than OR.
  30. Evaluate the expression: false || false.
    false. OR requires at least one operand to be true.
  31. What is the value of false && true || true?
    true. OR has lower precedence than AND.
  32. What is a Boolean expression?
    An expression that evaluates to true or false. Boolean data type has only two possible values.
  33. What is the result of !(true || true)?
    false. NOT inverts the true result of OR to false.
  34. What is the value of !true && !false?
    false. NOT true is false, NOT false is true, AND gives false.
  35. Evaluate the logic: !true && true.
    false. NOT true is false, AND with true gives false.
  36. What is the result of !true || false?
    false. NOT true is false, then OR with false stays false.
  37. What is the result of !false || false?
    true. NOT false is true, then OR with false gives true.
  38. Identify the result of true && true.
    true. AND requires both operands to be true.

Study these flashcards