Deck 5: More on the Selection Structure
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
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 5: More on the Selection Structure
1
A nested selection structure can appear within or immediately before the True path or the False path of the outer selection structure.
False
2
Each Case clause represents a different ____.
A) method
B) program
C) path
D) partition
A) method
B) program
C) path
D) partition
C
3
Both paths in a selection structure can include instructions that declare variables, perform calculations, and so on.
True
4
A primary decision is always made by an outer selection structure, while a secondary decision is always made by a nested selection structure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
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 ____.
A) truth table
B) nested selection structure
C) decision tree
D) decision plan
A) truth table
B) nested selection structure
C) decision tree
D) decision plan
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
The expression 1 To 5 in the Case 1 To 5 clause specifies the range of numbers from ____.
A) 2 to 5, inclusive
B) 2 to 4, inclusive
C) 1 to 4, inclusive
D) 1 to 5, inclusive
A) 2 to 5, inclusive
B) 2 to 4, inclusive
C) 1 to 4, inclusive
D) 1 to 5, inclusive
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The Select Case statement ends with the ____ clause.
A) End Select
B) End
C) Finish
D) Stop Select
A) End Select
B) End
C) Finish
D) Stop Select
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
When using the Select Case statement, the data type of the ____ must be compatible with the data type of the selectorExpression.
A) Case expression
B) Case Else clause
C) instructions
D) expressions
A) Case expression
B) Case Else clause
C) instructions
D) expressions
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
If the Select Case statement includes a Case Else clause, the Case Else clause must be the ____ clause in the statement.
A) last
B) only
C) primary
D) secondary
A) last
B) only
C) primary
D) secondary
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
You use the ____ keyword when you know only one end of a range (either the upper or lower end).
A) Is
B) All
C) To
D) From
A) Is
B) All
C) To
D) From
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
When a multiple-alternative selection structure has many paths from which to choose, it is often simpler and clearer to use the If/ElseIf/Else form of the selection structure rather than the Select Case statement.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
You use the ____ keyword when you know both the upper and lower values in a range.
A) Is
B) All
C) To
D) From
A) Is
B) All
C) To
D) From
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
The ____ in a flowchart represents the multiple-alternative selection structure's condition.
A) circle
B) diamond
C) square
D) triangle
A) circle
B) diamond
C) square
D) triangle
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
An application may need to communicate with the user during run time.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
Each of the individual Case clauses, except the Case Else clause, must contain a(n) ____, which can include one or more expressions.
A) valueList
B) resultList
C) selectList
D) expressionList
A) valueList
B) resultList
C) selectList
D) expressionList
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
To include two groups of radio buttons in an interface, at least one of the groups must be placed within a ____, such as a group box, panel, or table layout panel.
A) Case
B) structure
C) container
D) statement
A) Case
B) structure
C) container
D) statement
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
A(n) ____ selection structure can choose from several alternatives.
A) open-ended
B) concurrent
C) dynamic
D) multiple-alternative
A) open-ended
B) concurrent
C) dynamic
D) multiple-alternative
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A _____ decision is always made by an outer selection structure.
A) dynamic
B) static
C) primary
D) secondary
A) dynamic
B) static
C) primary
D) secondary
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
In situations where the selection structure has many paths from which to choose, it is often simpler and clearer to code the selection structure using the ____ statement.
A) Select Case
B) Begin/End
C) If/Then
D) Do/Loop
A) Select Case
B) Begin/End
C) If/Then
D) Do/Loop
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
A ____ decision is always made by a nested selection structure.
A) static
B) dynamic
C) primary
D) secondary
A) static
B) dynamic
C) primary
D) secondary
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
You display the message box that contains text, one or more buttons, and an icon using the ____ method.
A) MessageBox.Show
B) CommunicationBox.Show
C) Message.Show
D) Show.box
A) MessageBox.Show
B) CommunicationBox.Show
C) Message.Show
D) Show.box
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Can contain any combination of variables, constants, methods, operators, and properties.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Can contain any combination of variables, constants, methods, operators, and properties.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
The flowchart symbol for the multiple-alternative selection structure.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
The flowchart symbol for the multiple-alternative selection structure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
A control's KeyPress event occurs each time the user presses a key while the control ____.
A) has the focus
B) contains a value
C) is highlighted
D) has a parameter
A) has the focus
B) contains a value
C) is highlighted
D) has a parameter
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A simpler and clearer way to code a multiple-alternative selection structure.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A simpler and clearer way to code a multiple-alternative selection structure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The recommended maximum number of radio buttons in a group is ____.
A) four
B) five
C) seven
D) unlimited
A) four
B) five
C) seven
D) unlimited
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Between the Select Case and End Select clauses are the individual ____________________ clauses.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Occurs each time the user presses a key while the control has the focus.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Occurs each time the user presses a key while the control has the focus.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Multiple-alternative selection structures are also called ____________________ structures.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
You add a radio button to a form using the ____ tool in the toolbox.
A) RadioButton
B) Radio
C) Button
D) RadioTool
A) RadioButton
B) Radio
C) Button
D) RadioTool
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A property of the KeyPress event procedure's e parameter; used to cancel the key pressed by the user.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A property of the KeyPress event procedure's e parameter; used to cancel the key pressed by the user.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Immediately preceded by a space and appears at the end of a physical line of code.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Immediately preceded by a space and appears at the end of a physical line of code.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
A control's ____________________ event occurs each time the user presses a key while the control has the focus.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
To prevent a text box from accepting an inappropriate character, you first use the ____ parameter's KeyChar property to determine the pressed key.
A) t
B) a
C) e
D) p
A) t
B) a
C) e
D) p
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Always made by an outer selection structure.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
Always made by an outer selection structure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
The ____ radio button is either the radio button that represents the user's most likely choice or the first radio button in a group of buttons.
A) initial
B) primary
C) default
D) open
A) initial
B) primary
C) default
D) open
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A selection structure that can choose from several alternatives.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A selection structure that can choose from several alternatives.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Match each item with a statement below.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A property of the KeyPress event procedure's e parameter; determines the key pressed by a user.
a.Handled property
f.diamond
b.multiple-alternative
g.KeyChar property
c.Select Case
h.line continuation character
d.primary decision
i.KeyPress event
e.selectorExpression
A property of the KeyPress event procedure's e parameter; determines the key pressed by a user.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
____________________ buttons allow you to limit the user to only one choice from a group of two or more related but mutually exclusive choices.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
When do you typically use multiple-alternative selection structures?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
In code, how do you refer to the Backspace key on your keyboard?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Describe an example of when you would want to use a radio button.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
How do you prevent the entry of inappropriate characters in a text box?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
Describe three characteristics of the radio button interface.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
How does the diamond in the multiple-alternative selection structure differ from the diamonds in the single-alternative and dual-alternative selection structures?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
When displaying a message in the message box using the MessageBox.Show method, what three items appear in the message box?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
What are the two keywords that you can use to specify a range of values in a Case clause's expressionList? When is each keyword used?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
What is the difference between a primary decision and a secondary decision?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
How do you include more than one expression in an expressionList?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck