Making Decisions Flashcards
What is the term used to describe this?
- value can be only true or false
- used in every selection structure
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
Boolean Expression
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
What is the term used to describe this?
- alternative(or binary) selection structure
- provides an action for each of two possible outcomes
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
Dual
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
What is the term used to describe this?
- alternative (or unary) selection structure
- action is provided for only one outcome
if - then
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
Single
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
What is the term used to describe this?
Holds the action or actions that execute when
the tested condition in the decision is true
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
then clause
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
What is the term used to describe this?
Executes only when the tested condition in
the decision is false
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
else clause
EVALUATING BOOLEAN EXPRESSIONS TO MAKE COMPARISONS
What is the term used to describe this?
- Six types supported by all modern programming
languages - Each of these operators is Binary, each requires
two operands
4 = 4 100 <= 99
USING THE RELATIONAL COMPARISON OPERATORS
Relational Comparison Operators
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
- Two values compared can be either variables or
constants
CurrentTotal = 100
Variables = numeric constant
USING THE RELATIONAL COMPARISON OPERATORS
Relational Comparison Operators
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
- Two values compared can be either variables or
constants
CurrentTotal = 100
Variables = numeric constant
USING THE RELATIONAL COMPARISON OPERATORS
Relational Comparison Operators
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
Each will always evaluate to the same result
Example:
20 = 20?
40 = 30?
USING THE RELATIONAL COMPARISON OPERATORS
Trivial Expressions
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
Each will always evaluate to the same result
Example:
20 = 20?
40 = 30?
USING THE RELATIONAL COMPARISON OPERATORS
Trivial Expressions
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
OPERATOR NAME DISCUSSION
EVALUATES AS TRUE WHEN ITS OPERANDS
ARE EQUIVALENTS. MANY LANGUAGES USE A
DOUBLE EQUAL SIGN (==) TO AVOID
CONFUSION WITH THE ASSIGNMENT
OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
= EQUIVALENCY OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
OPERATOR NAME DISCUSSION
EVALUATES AS TRUE WHEN ITS OPERANDS
ARE EQUIVALENTS. MANY LANGUAGES USE A
DOUBLE EQUAL SIGN (==) TO AVOID
CONFUSION WITH THE ASSIGNMENT
OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
= EQUIVALENCY OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
OPERATOR NAME DISCUSSION
EVALUATES AS TRUE WHEN THE LEFT
OPERAND IS GREATER THAN THE RIGHT
OPERAND
USING THE RELATIONAL COMPARISON OPERATORS
> GREATER-THAN OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
OPERATOR NAME DISCUSSION
EVALUATES AS TRUE WHEN THE LEFT
OPERAND IS LESS THAN THE RIGHT
OPERAND.
USING THE RELATIONAL COMPARISON OPERATORS
< LESS-THAN
OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
EVALUATES AS TRUE WHEN THE LEFT
OPERAND IS GREATER THAN OR EQUIVALENT
TO THE RIGHT OPERAND
USING THE RELATIONAL COMPARISON OPERATORS
> = GREATER-THAN
OR EQUAL-TO
OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
EVALUATES AS TRUE WHEN THE LEFT
OPERAND IS LESS THAN OR EQUIVALENT TO
THE RIGHT OPERAND.
USING THE RELATIONAL COMPARISON OPERATORS
<= LESS-THAN OR
EQUAL-TO
OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS
What is the term used to describe this?
EVALUATES AS TRUE WHEN ITS OPERANDS ARE NOT EQUIVALENT.
SOME LANGUAGES USE AN
EXCLAMATION POINT FOLLOWED BY AN EQUAL
SIGN TO INDICATE NOT EQUAL TO OPERATOR DIFFERS IN THE COMMON PROGRAMMING LANGUAGES, THIS BOOK WILL MOST OFTEN SPELL OUT “IS NOT EQUAL TO” IN FLOWCHARTS
AND PSEUDOCODE.
USING THE RELATIONAL COMPARISON OPERATORS
<> NOT-EQUAL TO OPERATOR
USING THE RELATIONAL COMPARISON OPERATORS