Ch. 8 Flashcards
loop structures and booleans
1
Q
A loop pattern that asks the user whether to continue on each iteration is called a(n)
A
interactive loop
2
Q
A loop structure that tests the loop condition after executing the loop body is called a
A
post-test loop
3
Q
What statement can be executed in the body of a loop to cause it to terminate?
A
break
4
Q
Which of the following is not a valid rule of Boolean algebra?
A
(True or x) == True
5
Q
A loop that never terminates is called
A
infinite
6
Q
Which line would not be found in a truth table for and?
A
TFT
7
Q
Which line would not be found in a truth table for or
A
FTF
8
Q
not (P and Q)
A
FTTT
9
Q
(not P) and Q
A
FFTF
10
Q
(not P) or (not Q)
A
FTTT