Name:     ID: 
 
    Email: 

CS104 Visual Basic Quiz VI

Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

 1. 

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, 4, 5
b.
No numbers will print on the form.
c.
1, 2, 3, 4
d.
1, 2, 3
 

 2. 

You can move an object from left to right on the screen by using the object's ____ property.
a.
Left
b.
Across
c.
Relocate
d.
Move
 

 3. 

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
 

 4. 

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.
endvalue
d.
incrementor
 

 5. 

Which of the following For instructions is valid?
a.
For intNum = 1 to 5 Step 1
b.
For intX = .5 to 1.25 Step .25
c.
For intNum = 1 to 4
d.
all of the above
 

 6. 

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.
1, 2
b.
1, 2, 3
c.
No numbers will print on the form.
d.
1, 2, 3, 4
 

 7. 

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
 

 8. 

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
a.
4
b.
1
c.
5
d.
6
 

 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. 

If you omit the stepvalue in a For...Next statement, Visual Basic uses a stepvalue of ____.
a.
1 (a positive one)
b.
0 (zero)
c.
-1 (a negative one)
d.
None of the above because you can't omit the stepvalue from the For...Next instruction
 



 
Submit          Reset Help