Preview (3 of 10 pages)

Preview Extract

Chapter 4: Making Decisions
TRUE/FALSE
1. Every decision you make in a computer program involves evaluating a Boolean
expression.
Answer: True
2. In any Boolean expression, the two values compared can be either variables or constants.
Answer: True
3. Any decision can be made using combinations of just two types of comparisons: equal and
not equal.
Answer: False
4. Most programming languages allow you to ask two or more questions in a single
comparison.
Answer: True
5. 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.
Answer: True
6. When you need to satisfy two or more criteria to initiate an event in a program, you must
make sure that the second decision is made entirely independently of the first decision.
Answer: False
7. Besides AND and OR operators, most languages support a NOT operator.
Answer: True
8. Most programming languages limit the number of AND and OR operators in an
expression.
Answer: False
9. When you combine AND and OR operators, the OR operators take precedence, meaning
their Boolean values are evaluated first.
Answer: False
10. You can use parentheses to override the default order of operations.
Answer: True
MULTIPLE CHOICE
1. A selection with an action that is associated with each of two possible outcomes is known
as a(n) ____ selection.
a. unary

b. binary
c. octal
d. semiconductor
Answer: B
2. The keyword that is NOT included in a single-alternative selection is ____.
a. if
b. then
c. else
d. endif
Answer: C
3. Boolean expressions are named after ____.
a. Harold Boolean
b. Henry Boole
c. George Boole
d. Gerhardt Boolean
Answer: C
4. ____ operators require two operands.
a. Unary
b. Tertiary
c. Binary
d. Double
Answer: C
5. The ____ sign means “greater than.”
a. , =,

12 AND age < 19) OR validId = "Yes", even though the evaluation would be the same
without the parentheses.
You can use nesting if statements instead of using AND and OR operators.

Test Bank for Programming Logic and Design
Joyce Farrell
9781111969752, 9788131525906, 9781111825959

Document Details

Related Documents

Close

Send listing report

highlight_off

You already reported this listing

The report is private and won't be shared with the owner

rotate_right
Close

Send Message

image
Close

My favorites

image
Close

Application Form

image
image
image
arrow_left
arrow_right