NEW
Font size
WorksheetsInscoe - CPI 5.05
Total questions: 26
Worksheet time: 13mins
In the code shown, how many iterations will this loop execute?
4
5
6
10
When the MessageBox is displayed in the code shown, the variable intJ will be:
8.
10.
12.
unknown.
In the code shown, the For loop has how many iterations?
0
5
6
7
In the code shown, what is the value stored in intX when the loop terminates?
0
5
6
8
In the code shown, how many times does the program count through the loop structure?
0
1
5
The loop will not start.
In the code shown, when the MessageBox is displayed, the variable intJ will be:
8.
10.
12.
unknown.
Examine the code shown. What value is stored in intResult after the loop executes?
6
10
11
12
In the following code, how many times does the program count through the loop structure?
For intCounter as integer = 1 To 9 Step 3
0
1
3
9
What type of Do Loop is executed by the code shown?
Random Do Loop
Fixed Do Loop
Pre Test Do Loop
Post Test Do Loop
The Loop structure is also referred to as a:
decision.
block.
repetition.
case.
Typically, accumulators and counters are initialized to which value?
1
0
2
Nothing
In the code shown, how many iterations will this loop execute?
4
5
6
10
In the code shown, if the line of code intJ += 2 were changed to intJ -= 2 , what would be the result?
Everything would work the same, except intJ would be negative.
No significant change would be seen.
The program would lock up in an infinite loop.
The program would stop when intJ reaches 0.
In the following code, how many times does the program count through the loop structure?
For intCounter as integer = 1 To 9 Step -3
Infinite
1
9
3
In the code shown, the for loop has how many iterations?
4
5
6
7
Given the following statements:
Dim intNum As Integer = 0
Do
IntNum = intNum + 1
Loop While intNum < 5
How many times will the body of the Do ... Loop execute?
0
2
5
10
In the code shown, what is the value stored in intCount when the MessageBox is displayed?
0
5
6
7
Which is the correct syntax for a pretest Do Loop?
Do While condition
statements
End Do
Do While condition
statements
End While
Do While condition
statements
Loop
Do While condition
statements
Next
In the code shown, which variable is the accumulator?
intCount
intGrade
intSum
dblAvg
Given the following code segment, what is the value of intNumber that displays in the Label?
2
4
6
8
In the code below, this Do Loop is a:
Random Do Loop.
Fixed Do Loop.
Pre Test Do Loop.
Post Test Do Loop.
In what type of loop are the conditions evaluated before the instructions are processed?
Pretest
Finite
Infinite
Posttest
Given the following statements:
Dim intNum As Integer
For intNum = 1 to 5
MessageBox.Show(intNum)
Next intNum
What is the value of intNum after the last loop iteration?
1
5
6
8
In the code shown, which variable is the counter?
intCount
intGrade
intSum
dblAvg
In the code below, if the Random Number generator is fair, the value in intTot after the loop completes, on average, will tend to be close to:
200.
250.
300.
350.
Given the following statements:
Dim intNum As Integer
For intNum = 1 To 11
MessageBox.Show(intNum)
Next intNum
What is the value of intNum after the last loop iteration?
1
10
11
12
