CS113 - Ch04 Review - Making Decisions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

unary

The NOT operator is a _____ operator, meaning it takes only one operand.

if-then

The _____ clause is the part of the decision that holds the action or actions that execute when the tested condition in the decision is true.

else

The _____ clause of the decision is the part that executes only when the tested condition in the decision is false.

&&

The conditional AND operator in Java, C++, and C# is ____.

nested if

To avoid confusion, you can use ____statements instead of using AND and OR operators.

parentheses

Used to override the default order of operations.

case structure

Used when there are several distinct possible values for a single variable, and each value requires a different subsequent action.

AND

Using this operator, an expression that tests a condition with two parts that must both evaluate to true for an action to take place.

Boolean

A _____ expression is one that represents only one of two states, usually expressed as true or false.

dead

A path that can never be traveled.

True

A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the entire expression is true or false.

AND

A(n) _____ decision is a decision in which two conditions must be true for an action to take place.

a decision within another

An evaluation with multiple parts

False

Any decision can be made using combinations of just two types of comparisons: equal and not equal.

data type

Both operands in a comparison expression must be the same _____.

||

C#, C++, C, and Java use the symbol _____ as the logical OR operator.

first ask the question that is more likely to be false

For maximum efficiency, a good rule of thumb in an AND decision is to _____.

first ask the question that is more likely to be true

For maximum efficiency, a good rule of thumb in an OR decision is to _____.

false or false

In a truth table, the expression _____ is false.

true

In an AND decision, first ask the question that is less likely to be____________________.

case

Most languages allow a specialized selection structure called the _____ structure when there are several distinct possible values for a single variable, and each value requires a different subsequent action.

AND

Most programming languages allow you to ask two or more questions in a single comparison by using a(n) ____ operator that joins decisions in a single statement.

True

Most programming languages allow you to ask two or more questions in a single comparison.

a decision within another

Nested if

else clause

Part of a decision that executes only when the tested condition in the decision is false.

=, >=, <=, OR, AND

Relational comparison operators.

OR

When this operator is used, only one of the listed conditions must be met for the resulting action to take place.

nest

When you _____ decisions because the resulting action requires that two conditions be true, you must decide which of the two decisions to make first.

AND

When you combine AND and OR operators, the _____ operators take precedence, meaning their Boolean values are evaluated first.

OR

When you use the _____ operator, only one of the listed conditions must be met for the resulting action to take place.

trivial expressions

Will always evaluate to the same value.

range check

You can perform a _____ by making comparisons using either the lowest or highest value in a range of values.

True

You can use parentheses to override the default order of operations.

NOT

You use the _____ operator to reverse the meaning of a Boolean expression.

truth tables

____ are diagrams used in mathematics and logic to help describe the truth of an entire expression based on the truth of its parts.

Binary

_____ operators require two operands.


Kaugnay na mga set ng pag-aaral

Business Mathematics Chapter 9 - Payroll

View Set

Section 2: Texas Laws, Rules and Regulations

View Set

MKTG 5310, Quiz 3 (Ch. 13 and 16)

View Set

Google Professional Google Workspace Administrator Exam 1

View Set