Deck 9: Time to Leave the Nest Nested Selection Structures
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/25
Play
Full screen (f)
Deck 9: Time to Leave the Nest Nested Selection Structures
1
You use the selection structure to make a decision and then select the appropriate path-either the true path or the false path-based on the result.
True
2
In a nested structure, the instructions in both the true and false paths should be ____ within the outer selection structure.
A) assigned
C) collected
B) bracketed
D) indented
A) assigned
C) collected
B) bracketed
D) indented
D
3
A(n) ____ selection structure is contained within the outer selection structure.
A) nested
C) coated
B) indented
D) shell
A) nested
C) coated
B) indented
D) shell
A
4
The instructions in the true path of a nested structure should not be indented within the inner selection structure.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
Logical operators, sometimes referred to as ____ operators, allow you to combine two or more conditions into one compound condition.
A) truth
C) Boolean
B) compound
D) syntactic
A) truth
C) Boolean
B) compound
D) syntactic
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
With the ____ operator, all conditions must be True for the compound condition to be True.
A) AndAlso
C) AndElse
B) OrAlso
D) OrElse
A) AndAlso
C) AndElse
B) OrAlso
D) OrElse
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
The OrElse operator has a precedence number of 9.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
Expressions containing logical operators always evaluate to a(n) ____ value.
A) Boolean
C) string
B) conditional
D) compound
A) Boolean
C) string
B) conditional
D) compound
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
The AndAlso operator has a precedence number of 2.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
When either a selection structure's true path or its false path contains another selection structure, the inner selection structure is referred to as a(n) ____ structure.
A) indented
C) nested selection
B) nested
D) indented selection
A) indented
C) nested selection
B) nested
D) indented selection
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
When comparing two numbers, keep in mind that the first number can be greater than, less than, or equal to the second number.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
Only one path in a selection structure can include instructions that declare variables, perform calculations, and so on.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
When only one decision needs to be made, it does not require a nested selection structure.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
You cannot use a nested selection structure when more than one decision must be made before the appropriate action can be taken.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
With the ____ operator, only one of the conditions needs to be True for the compound condition to be True.
A) AndAlso
C) AndElse
B) OrAlso
D) OrElse
A) AndAlso
C) AndElse
B) OrAlso
D) OrElse
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
You use a ____ selection structure when more than one decision must be made before the appropriate action can be taken.
A) shell
C) logical
B) nested
D) split
A) shell
C) logical
B) nested
D) split
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
Only one path in a selection structure can include other selection structures.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
When swapping values there is no need to swap when the two numbers are equal.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
Logical operators are always evaluated before any comparison operators in an expression.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Like expressions containing comparison operators, expressions containing logical operators always evaluate to a Boolean value.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
If an expression contains logical operators, comparison operators, and arithmetic operators, ____.
A) the comparison operators are evaluated last
B) the arithmetic operators are evaluated last
C) the logical operators are evaluated last
D) the operators are evaluated in order
A) the comparison operators are evaluated last
B) the arithmetic operators are evaluated last
C) the logical operators are evaluated last
D) the operators are evaluated in order
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____ operator last.
A) *
C) >
B) <
D) AndAlso
A) *
C) >
B) <
D) AndAlso
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____ operator first.
A) *
C) >
B) <
D) AndAlso
A) *
C) >
B) <
D) AndAlso
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
If an expression contains logical operators, comparison operators, and arithmetic operators, ____.
A) the comparison operators are evaluated first
B) the arithmetic operators are evaluated first
C) the logical operators are evaluated first
D) the operators are evaluated in order
A) the comparison operators are evaluated first
B) the arithmetic operators are evaluated first
C) the logical operators are evaluated first
D) the operators are evaluated in order
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
The pseudocode "if the hours worked are greater than or equal to 0 but less than or equal to 40" is coded as ____ in Visual Basic.
A) If decHours > 0 AndAlso decHours < 40
B) If decHours => 0 AndAlso decHours =< 40
C) If decHours >= 0 AndAlso decHours <= 40
D) If decHours >= 40 AndAlso decHours <= 0
A) If decHours > 0 AndAlso decHours < 40
B) If decHours => 0 AndAlso decHours =< 40
C) If decHours >= 0 AndAlso decHours <= 40
D) If decHours >= 40 AndAlso decHours <= 0
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck