Multiple Choice
Identify
the letter of the choice that best completes the statement or answers
the question.
|
|
1.
|
Visual
Basic uses the ____ variable in the For... Next statement to keep track
of the number of times the loop instructions are processed.
a.
|
startvalue
|
b.
|
counter
|
c.
|
incrementor
|
d.
|
endvalue
|
|
|
|
|
2.
|
Which
of the following For instructions is valid?
a.
|
For intNum = 1 to 4
|
b.
|
For
intX = .5 to 1.25 Step .25
|
c.
|
For intNum = 1 to 5 Step 1
|
d.
|
all
of the above
|
|
|
|
|
3.
|
How
many times will the instruction within the following For Next loop be
processed?
For intX = 1 to 5 Step 1 Print intX
Next intX
|
|
4.
|
You
can move an object from left to right on the screen by using the object's
____ property.
a.
|
Across
|
b.
|
Move
|
c.
|
Left
|
d.
|
Relocate
|
|
|
|
|
5.
|
What
numbers will print on the form when the following code is processed?
intX
= 1 Do Print intX
intX = intX + 1 Loop Until intX > 4
a.
|
1,
2, 3
|
b.
|
1,
2, 3, 4, 5
|
c.
|
No
numbers will print on the form.
|
d.
|
1, 2, 3, 4
|
|
|
|
|
6.
|
In
the ____ loop, the loop instructions are processed only if the condition
evaluates to true.
a.
|
Do
Until
|
b.
|
Do While
|
c.
|
both a and b
|
d.
|
None
of the above
|
|
|
|
|
7.
|
If
you omit the stepvalue in a For...Next statement, Visual Basic uses
a stepvalue of ____.
a.
|
1
(a positive one)
|
b.
|
-1
(a negative one)
|
c.
|
0
(zero)
|
d.
|
None of the above because you can't omit the stepvalue
from the For...Next instruction
|
|
|
|
|
8.
|
Which
of the following will initialize the curTotSales accumulator to 0 (zero)?
a.
|
Dim
curTotSales as Currency
|
b.
|
Dim curTotSales = 0
|
c.
|
curTotSales
= 0
|
d.
|
both
a and c
|
|
|
|
|
9.
|
When
using the ____ loop, the loop instructions are processed only if the
condition evaluates to false.
a.
|
Do
While
|
b.
|
Do Until
|
c.
|
both a and b
|
d.
|
None
of the above
|
|
|
|
|
10.
|
What
numbers will print on the form when the following code is processed?
intX
= 1 Do While inX < 3 Print
intX intX = intX + 1 Loop
a.
|
No numbers will print on the form.
|
b.
|
1,
2, 3, 4
|
c.
|
1,
2, 3
|
d.
|
1,
2
|
|
|
|