Boolean Expressions (College Board AP® Computer Science Principles): Flashcards

1/12

0Still learning

Know0

Cards in this collection (12)

  • Define Boolean value.

    A Boolean value is a value that can only be true or false.

  • Define relational operator.

    A relational operator compares two values and returns a Boolean result.

  • Name the six relational operators in AP CSP pseudocode.

    The relational operators are =, ≠, <, >, ≤, and ≥.

  • What does 7 ≤ 7 evaluate to?

    7 ≤ 7 evaluates to true.

  • Name three kinds of Boolean operand.

    Boolean operands can be literal Boolean values, variables that hold Boolean values, or relational expressions.

  • True or False?

    true OR false evaluates to false.

    False.

    true OR false evaluates to true, because OR is true if at least one operand is true.

  • Name the three logic operators in AP CSP pseudocode.

    The three logic operators are NOT, AND, and OR.

  • When does AND return true?

    AND returns true only if both operands are true.

  • What does the NOT operator do?

    The NOT operator reverses a Boolean value, so NOT true evaluates to false.

  • A _____ _____ shows every possible combination of Boolean inputs and the corresponding output.

    A truth table shows every possible combination of Boolean inputs and the corresponding output.

  • What is displayed when this code segment runs?

    age ← 15
    
    DISPLAY(age ≥ 13 AND age < 18)

    The code segment displays true, because 15 ≥ 13 is true and 15 < 18 is true.

  • What is displayed when this code segment runs?

    isRaining ← false
    
    hasUmbrella ← false
    
    DISPLAY((NOT isRaining) AND hasUmbrella)

    The code segment displays false: NOT isRaining is true, but hasUmbrella is false, and true AND false is false.

Sign up to unlock flashcards

or