Programming Logic and Design,
Chapter 4, Review Questions (4-8c)
Complete Solutions
b - ANSWER-If m is true and n is false, then _____________.
a. m AND n is true
b. m AND n is false
c. m OR n is false
d. If m is true, then n must be true.
a - ANSWER-If p is true and q is false, then ____________.
a. p OR q is true
b. p OR q is false
c. p AND q is true
d. p is greater than q
d - ANSWER-Which of the lettered choices is equivalent to the following decision?
if x > 10 then
if y > 10 then
output "x"
endif
endif
a. if x > 10 OR y > 10 then output "X" endif
b. if x > 10 AND x > y then output "X" endif
c. if y > x then output "X" endif
d. if x > 10 AND y > 10 then output "X" endif
a - ANSWER-If 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 .
a. in an OR decision
b. in an AND decision
c. in any decision
d. never
d - ANSWER-Which of the following is a poorly written, trivial Boolean expression?
a. a > b AND b > c
b. d = 10 OR d > 20
c. e < f AND g < 100 AND g <> 5
d. h < 10 AND h = 4
Chapter 4, Review Questions (4-8c)
Complete Solutions
b - ANSWER-If m is true and n is false, then _____________.
a. m AND n is true
b. m AND n is false
c. m OR n is false
d. If m is true, then n must be true.
a - ANSWER-If p is true and q is false, then ____________.
a. p OR q is true
b. p OR q is false
c. p AND q is true
d. p is greater than q
d - ANSWER-Which of the lettered choices is equivalent to the following decision?
if x > 10 then
if y > 10 then
output "x"
endif
endif
a. if x > 10 OR y > 10 then output "X" endif
b. if x > 10 AND x > y then output "X" endif
c. if y > x then output "X" endif
d. if x > 10 AND y > 10 then output "X" endif
a - ANSWER-If 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 .
a. in an OR decision
b. in an AND decision
c. in any decision
d. never
d - ANSWER-Which of the following is a poorly written, trivial Boolean expression?
a. a > b AND b > c
b. d = 10 OR d > 20
c. e < f AND g < 100 AND g <> 5
d. h < 10 AND h = 4