NEW
Font size
WorksheetsUnit 6: Repetition Test Review
Total questions: 20
Worksheet time: 10mins
Determine how many times the loop will execute.
count = 20
Do While count > 10
...
count = count - 2
Loop
5
10
6
11
Determine how many times the loop will execute.
counter = 0
Do While counter < 5
...
counter = counter + 1
Loop
4
5
6
7
Determine how many times the loop will execute.
var = 0
Do
...
var = var + 3
Loop Until var > 9
2
3
4
5
Determine how many times the loop will execute.
var = 0
Do
...
var = var + 10
Loop Until var > 2
0
1
2
3
Determine how many times the loop will execute.
var = 0
Do While var > 2
...
var = var + 5
Loop
0
1
2
3
Determine how many times the loop will execute.
For i = 3 To 6
...
Next
3
4
5
6
Determine how many times the loop will execute.
For i = 10 To 20 Step 2
...
Next
7
4
5
6
Determine how many times the loop will execute.
For i = 2001 To 2010
...
Next
8
9
10
11
Trace the program and determine the output.
yr = 0
Do While yr < 4
lstOutput.AddItem(yr)
yr = yr + 1
Loop
0
1
2
3
0
1
2
3
4
0
1
2
1
2
3
Trace the program and determine the output.
var = 0
Do While var < 4
lstOutput.AddItem("Einstein")
var = var + 2
Loop
Einstein
Einstein
Einstein
Einstein
Einstein
Einstein
Einstein
Einstein
Einstein
Einstein
Trace the program and determine the output.
var = 0
Do
lstOutput.AddItem("Newton")
var = var + 3
Loop Until counter > 9
Newton
Newton
Newton
Newton
Newton
Newton
Newton
Newton
Newton
Newton
Trace the program and determine the output.
For k = 1 To 5
lstOutput.AddItem("VB97")
Next
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
VB97
What is the definition of a counter variable?
variable that counts up as a loop repeats
value that determines whether a loop executes
variable that adds up values as a loop repeats
What is the definition of an accumulator variable?
variable that counts up as a loop repeats
value that determines whether a loop executes
variable that adds up values as a loop repeats
What is the definition of an sentinel value?
variable that counts up as a loop repeats
value that determines whether a loop executes
variable that adds up values as a loop repeats
Determine whether the loop will be infinite.
For i = 1 To 6
lstOutput("Repetition")
Next
infinite
not infinite
Determine whether the loop will be infinite.
test = 0
Do While test < 3
test = test + 1
Loop
infinite
not infinite
Determine whether the loop will be infinite.
test = 0
Do While test < 3
test = test - 1
Loop
infinite
not infinite
Determine whether the loop will be infinite.
test = 8
Do
test = test - 1
Loop Until test < 3
infinite
not infinite
Determine whether the loop will be infinite.
test = 4
Do
test = test +1
Loop Until test < 3
infinite
not infinite
