Exam 5: Decision Structures
In an If...Then statement, the If keyword should appear on the first line with the conditional expression, and the Then keyword should appear on the second line.
False
The ____ of a variable is defined by where it is declared within a program.
D
Visual Basic provides six different logical operators. Briefly describe the function of each.
The And logical operator allows you to combine two or more conditions into a compound condition that can be tested with an If statement. If any of the conditions stated in the compound condition is false, the compound condition is considered false and the statements following the Else portion of the If statement will be executed. When the Or logical operator is used to connect two or more conditions, the compound condition is true if any tested condition is true. Even if four conditional statements are included in the compound condition, if one conditional statement in the compound condition is true, the entire statement is considered true. The Not logical operator allows you to state conditions that are best expressed in a negative way. In essence, it reverses the logical value of a condition on which it operates. With the Xor operator, when one condition in the compound is true, but not both, the compound condition is true. With the AndAlso operator, as soon as a condition is found to be false, no further conditions are tested and the compound condition is false. With the OrElse operator, as soon as a condition is found to be true, no further conditions are tested and the compound condition is true.
In a Select Case structure, the ____ statement includes all conditions not specifically tested for in the other Case statements.
To end a Select Case structure, a(n) ____ statement is used.
Case 5-2 Eric used to have a small reference card that he kept handy to remind him which MsgBoxButton arguments values translate to which buttons in the dialog box, but then he lost the card. He calls over to you for help in reminding him what values correspond to what. Now, Eric needs help in remembering which of the following options corresponds to a dialog box that displays an information icon and offers the Retry and Cancel buttons. Which of the following is the right answer?
In an If...Then...Else statement, if the condition is false, the statements between the Else and End If keywords will be executed.
The logical operator ____ has the highest priority and is evaluated first.
____________________ is the MsgBoxButtons argument that displays the Yes and No buttons.
Statements for a true condition and statements for a false condition can both be executed based on a single comparison.
What are the steps for automatically indenting code in an If…Then statement?
In a Select Case structure, each ____________________ statement specifies a value for which the test expression is checked.
When the object indicated by a RadioButton is selected by the user, the ____ property changes from False to True.
You can create your own code snippets but they cannot be added to the library.
An expression using the logical operator ____ will evaluate to true only when both of the conditions are true.
To test a second condition only after the result of the first condition is known, ____________________ If statements can be used.
The ____________________ procedure found in the MessageBox class is used to display a message in a message box.
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)