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.