A expression has one of two values: true or false.
C. Boolean
In a selection, the else clause executes
C. when the tested condition is false
The greater-than operator evaluates as true when
B. the left operand is greater than the right operand
A trivial Boolean expression is one that
A. always has the same value
If x <=y is true, then
B. x > y is false
If j <> k is true, then
D. Both b and c are true
In an AND condition, the most efficient technique is to first ask the question that
A. is least likely to be true
If a is true and b is false, then
D. a AND b is false
If p is true and q is false, then
C. p OR q is true
Which of the lettered choices is equivalent to the following decision?
if x > 10 then
if y > 10 then
output "X"
endif
endif
D. if x > 10 AND y > 10 then output "X" endif
If a conditionA is 30 percent likely to be true and conditionB is 10 percent likely to be true, then it is most efficient to test conditionA first
d never
C. in an OR decision
Which of the following is a poorly written, trivial Boolean expression?
D. a < 10 AND a > 40
Which of the following must always be false?
D. e > 10 AND e < 7
Which of the following must always be true?
A. g <> 12 OR g <> 15
In the following pseudocode, what percentage raise will an employee in Department 8 receive?
if department < 5 then
raise = SMALL_RAISE
else
if department < 14 then
raise = MEDIUM_RAISE
else
if department < 9 then
raise = BIG_RAISE
endif
endif
endif
C. MEDIUM_RAISE
In the following pseudocode, what percentage raise will an employee in Department 10 receive?
if department < 2 then
raise = SMALL_RAISE
else
if department < 6 then
raise = MEDIUM_RAISE
else
if department < 10 then
raise = BIG_RAISE
endif
endif
endif
C. impossible to tell
When you use a range check, you always compare a variable to value in the range.
B. an end-of-range value
If sales = 100, rate = 0.10, and expenses = 50, which of the following expressions is true?
D. two of the above
If a is true, b is true, and c is false, which of the following expressions is true?
D. two of the above
If d is true, e is false, and f is false, which of the following expressions is true?