Self Review Exercises 5 Flashcards

1
Q

SRE 5

True or False: The Case Else is required in the Select … Case selection statement

A

False. The Case Else is optional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.

A

False. BOTH of the simple conditions must be true for the entire expression to be true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SRE 5

True or False: An expression containing the Or operator is true if either or both of its operands are true

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SRE 5

True or False: Logical operator Or performs short-circuit evaluation

A

False. Logical Operator Or always evaluates both of its operands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

a) requires exactly one operand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SRE 5

The ____ operator is used to ensure that two conditions are both true

a) Xor
b) AndAlso
c) Also
d) OrElse

A

b) AndAlso

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SRE 5

Counter controlled repetition _____ the control variable after each iteration

a) increments
b) initializes
c) decrements
d) Either answer 1 or 3

A

d) Either answer 1 or 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SRE 5

Select Case is a ______ selection statement

a) multiple
b) double
c) single
d) None of the above

A

a) multiple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

c) When the controlling expression does not match any other cases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

b) Is

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SRE 5

Use a(n) ____ to separate multiple conditions in a Case statement

a) period
b) asterisk
c) comma
d) colon

A

c) comma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

SRE 5

True or False: The Do… Loop While statement tests the loop-continuation condition before the loop body is performed

A

False.

The Do… Loop While statement tests the loop-continuation condition after the loop body is performed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

SRE 5

True or False: The Or operator has a higher precedence than the And operator.

A

False.

The And operator has higher precedence than the Or operator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SRE 5

Which property specifies whether a CheckBox is selected?

a) Selected
b) Checked
c) Clicked
d) Check

A

b) Checked

17
Q

SRE 5

Call the ____ method of class MessageBox to display a message dialog.

a) Display
b) Message
c) Open
d) Show

A

d) Show

18
Q

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

A

c) is True after the body executes

19
Q

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

A

b) never becomes False

20
Q

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

A

c) for True after the body executes

21
Q

SRE 5

What aspect of the control variable determines whether looping should continue?

a) name
b) initial value
c) type
d) final value

A

b) initial value

22
Q

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

a) 1

23
Q

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

a) initial value of the counter variable

24
Q

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

A

b) For i As Integer = 25 to 5 Step -5

25
Q

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

a) Vary the control variable from 81 to 102 in increments of 1

26
Q

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

A

c) Increment

27
Q

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

A

d) For i = 0 to 50 Step 5