Self Review Exercises 5 Flashcards
SRE 5
True or False: The Case Else is required in the Select … Case selection statement
False. The Case Else is optional
SRE 5
True or False: The expression x > y And a < b is true if either x > y is true or a < b is true.
False. BOTH of the simple conditions must be true for the entire expression to be true.
SRE 5
True or False: An expression containing the Or operator is true if either or both of its operands are true
True
SRE 5
True or False: The expression x <= 4 is true if x is less than or equal to y and y is greater than 4
True
SRE 5
True or False: Logical operator Or performs short-circuit evaluation
False. Logical Operator Or always evaluates both of its operands
SRE 5
A unary operator _____
a) requires exactly one operand
b) requires two operands
c) must use the AndAlso keyword
d) can have no operands
a) requires exactly one operand
SRE 5
The ____ operator is used to ensure that two conditions are both true
a) Xor
b) AndAlso
c) Also
d) OrElse
b) AndAlso
SRE 5
Counter controlled repetition _____ the control variable after each iteration
a) increments
b) initializes
c) decrements
d) Either answer 1 or 3
d) Either answer 1 or 3
SRE 5
Select Case is a ______ selection statement
a) multiple
b) double
c) single
d) None of the above
a) multiple
SRE 5
When does the Case Else body execute?
a) Every time a Select Case statement executes
b) When more than one Case matches the controlling expression
c) When the controlling expression does not match any other cases
d) None of the above
c) When the controlling expression does not match any other cases
SRE 5
A Case that handles all values larger than a specified value must precede the > operator with keyword ___
a) Select
b) Is
c) Case
d) All
b) Is
SRE 5
Use a(n) ____ to separate multiple conditions in a Case statement
a) period
b) asterisk
c) comma
d) colon
c) comma
SRE 5
True or False: The Exit Do, Exit For, and Exit While statements, when executed in a repetition statement, cause immediate exit from only the current iteration of the repetition statement.
False.
These statements, when executed in a repetition statement, cause immediate exit from the repetition statement. The Continue Do, Continue For, and Continue While statements, when executed in a repetition statement, cause immediate exit from the current iteration of the repetition statement.
SRE 5
True or False: The Do… Loop While statement tests the loop-continuation condition before the loop body is performed
False.
The Do… Loop While statement tests the loop-continuation condition after the loop body is performed.
SRE 5
True or False: The Or operator has a higher precedence than the And operator.
False.
The And operator has higher precedence than the Or operator.
SRE 5
Which property specifies whether a CheckBox is selected?
a) Selected
b) Checked
c) Clicked
d) Check
b) Checked
SRE 5
Call the ____ method of class MessageBox to display a message dialog.
a) Display
b) Message
c) Open
d) Show
d) Show
SRE 5
The Do…Loop While statement body repeats when the loop-continuation condition ____.
a) is False after the body executes
b) is False before the body executes
c) is True after the body executes
d) is True before the body executes
c) is True after the body executes
SRE 5
An infinite loop occurs when the loop-continuation condition in a Do While… Loop or Do…Loop While statement ______.
a) never becomes True
b) never becomes False
c) is False
d) is tested repeatedly
b) never becomes False
SRE 5
The Do…Loop Until statement checks the loop-termination condition ______.
a) for False after the body executes
b) for False before the body executes
c) for True after the body executes
d) for True before the body executes
c) for True after the body executes
SRE 5
What aspect of the control variable determines whether looping should continue?
a) name
b) initial value
c) type
d) final value
b) initial value
SRE 5
If the Step is omitted, the increment of a For…Next statement defaults to ____.
a) 1
b) -1
c) 0
d) Either answer 1 or 2
a) 1
SRE 5
The value before the To keyword in a For…Next statement specifies the _____.
a) initial value of the counter variable
b) final value of the counter variable
c) increment
d) number of times the statement increments
a) initial value of the counter variable
SRE 5
Which of the following is the appropriate For…Next header for varying the control variable over the following sequence of values: 25, 20, 15, 10, 5?
a) For i As Integer = 5 to 25 Step 5
b) For i As Integer = 25 to 5 Step -5
c) For i As Integer = 5 to 25 Step -5
d) For i As Integer = 25 to 5 Step 5
b) For i As Integer = 25 to 5 Step -5
SRE 5
Which of the following statements describes the For…Next header shown below?
For i As Integer = 81 to 102
a) Vary the control variable from 81 to 102 in increments of 1
b) Vary the control variable from 81 to 102 in increments of 0
c) Vary the control variable from 102 to 81 in increments of -1
d) Vary the control variable from 81 to 102 in increments of 2
a) Vary the control variable from 81 to 102 in increments of 1
SRE 5
The _____ property determines by how much the current number in a NumericUpDown control changes when the user clicks the up arrow or the down arrow
a) Amount
b) Step
c) Increment
d) Next
c) Increment
SRE 5
Which For…Next header alters the control variable from 0 to 50 in increments of 5?
a) For i = 0 to 50 Step 50
b) For 0 to 50 Step 5
c) For i = 0 to 50 Step = 5
d) For i = 0 to 50 Step 5
d) For i = 0 to 50 Step 5