Deck 4: Decision Structures and Boolean Logic
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/44
Play
Full screen (f)
Deck 4: Decision Structures and Boolean Logic
1
The ________ operator could be used,in some situations,to simplify nested selection structures.
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
A
2
A condition is a _____________ expression.
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
A
3
If the expression is false,the ____________ operator will return true.
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
B
4
What two logical operators perform short-circuit evaluation?
A)NOT and OR
B)AND and OR
C)AND and NOT
D)All of the Above
E)None of the Above
A)NOT and OR
B)AND and OR
C)AND and NOT
D)All of the Above
E)None of the Above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
5
Which structure is a logical design that controls the order in which a set of statements executes?
A)Control
B)Sequence
C)Module
D)Terminal
E)None of the above
A)Control
B)Sequence
C)Module
D)Terminal
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
6
What type of operator can be used to determine whether a specific relationship exists between two values?
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
7
What type of operators are the following?
> < >= <= == !=
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
> < >= <= == !=
A)Boolean
B)Relational
C)Logical
D)Mathematical
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
8
Which operator is used to determine that the operands are not exactly of the same value?
A)=
B)!
C)=!
D)==
E)None of the above
A)=
B)!
C)=!
D)==
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
9
Which operator would make the following expression true?
False _______ True
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
False _______ True
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
10
In many languages the case structure is called a ____________ statement.
A)Branch
B)Jump
C)Selective
D)Switch
E)All of the above
A)Branch
B)Jump
C)Selective
D)Switch
E)All of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
11
The _________ operator is a unary operator as it works with only one operand.
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
12
It is possible to write a complete program using only a decision structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
13
Which of the following operators reverses the logic of its operand?
A)NOT
B)AND
C)OR
D)All of the above
E)None of the above
A)NOT
B)AND
C)OR
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
14
Which operator would make the following expression false?
True _______ False
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
True _______ False
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
15
Which operator is best to determine whether x contains a value in the range of 10 through 57?
A)AND
B)NOT
C)OR
D)==
E)None of the above
A)AND
B)NOT
C)OR
D)==
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
16
Consider the following statement:
A store is giving a discount of 30% for all purchases of over $100.
Which of the following is not the appropriate structure to use to program the statement?
A)Control
B)Decision
C)Selection
D)Sequence
E)None of the above
A store is giving a discount of 30% for all purchases of over $100.
Which of the following is not the appropriate structure to use to program the statement?
A)Control
B)Decision
C)Selection
D)Sequence
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
17
The _______ symbol indicates that some condition must be tested in a flowchart.
A)Rectangle
B)Oval
C)Parallelogram
D)Square
E)Diamond
A)Rectangle
B)Oval
C)Parallelogram
D)Square
E)Diamond
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
18
A case structure is a ___________ alternative decision structure.
A)Single
B)Dual
C)Multiple
D)Single or dual
E)All of the above
A)Single
B)Dual
C)Multiple
D)Single or dual
E)All of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
19
A nested decision structure can be used to test more than one condition.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following is a logical operator?
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
A)AND
B)NOT
C)OR
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
21
In an expression with an OR operator,it does not matter which sub expression is true for the compound expression to be true.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
22
The expression with an AND operator ___________ when the expression on its left is false and so it does not evaluate the expression on its right.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
23
Decision structures are also known as selection structures.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
24
The _________________ decision structure provides only one alternative path of execution.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
25
A ____________ expression evaluates as either true or false.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
26
The first line of the case structure starts with the word CASE followed by the test expression.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
27
An If statement will produce unpredictable results if the programmer does not use proper indentations in pseudocode.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
28
When a program performs actions only under certain conditions,it is using a _________ structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
29
The value of the ____________ is compared with the values that follow each of the Case statements when a Select Case statement executes.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
30
Pseudocode could be logically incorrect if not properly indented.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
31
A nested decision structure can achieve the same logic as a case structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
32
The ____________ operator is used to determine whether the operands are exactly the same as each other.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
33
In an If-Then-Else statement,the Else clause marks the beginning of the statements to be executed when the Boolean expression is _______________.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
34
The _________ symbol is used to represent a selection structure in flowcharting.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
35
The __________ operator requires both sub expressions to be true for the compound expression to be true.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
36
The short-circuit evaluation is performed with expressions containing any logical operators.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
37
The If-Then-Else statement can be used to simplify a complex nested decision structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
38
Although the sequence structure is heavily used in programming,it cannot handle every type of task.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
39
In a _________________ decision structure,one path is taken if a condition is true and the other path is taken if the condition is false.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
40
The If-Then-Else statement should be used to write a single alternative decision structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
41
The statement(s)that immediately follow the __________ statement is executed if the test expression in the case structure does not match any case values.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
42
Boolean variables are commonly used as __________,which indicate whether a specific condition exits.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
43
The ____________ statement is commonly used in programming languages for case structure.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck
44
The _____ operator is best to determine whether a number is outside a range.
Unlock Deck
Unlock for access to all 44 flashcards in this deck.
Unlock Deck
k this deck