Chapter 4 Flashcards
Boolean expressions can only be
True or False
if-then-else decision is used for
what does the if-then expression holds
what does the else expression holds
selection structure
if-then holds the actions that execute when statement is true
else executes when condition is false
relational comparison operators are the
equal sign (=)
greater than sign (>)
less than sign (<)
greater than or equal to sign (>=)
less than or equal to sign (<=)
not equal to sign (<>)
trivial expressions
will evaluate same results
EX: 20=20
compound condition
ask multiple questions before outcome is determined
AND decision
requires both test to be true
requires a nested decision or a cascading if statement
instead of nesting decisions, you can use an
conditional AND statement
when nesting decisions, ask the question that
fails first
Conditional AND operator
asks 2 or more questions in a decision statement
each boolean expression must be true for entire expression to be true
truth table
diagrams that describe truth of an entire expression
short circuit evaluation
expression evaluated only as far as necessary to determine truth
Or decision
take action when one of the many conditions are true
Only one boolean expression must be true to produce a result of true
Not operator
reverses the meaning of a boolean expression (if not true, then its false/if not false, then its true)
range check
compare a variable to a series of values between limits (an interval)
if you want all conditions to be true, use what expression
the AND expression