| Wyo Visual Basic Ch. 5 Worksheet #2 |
Name - |
Deskcheck the following For/Next loops, tracing the intermediate values of all loop variables. Neatly label columns on the right side of this worksheet to show the intermediate values each variable. Place single slashes through all intermediate values except for the last value. Assume that all variables are initialized to zero. Also indicate how many beeps would sound with each exercise. Indicate if any loop is infinite or if it never iterates even one time.
1.
For intLoop1 = 5 To 10
Beep
Next intLoop1
2.
For intLoop2 = 2 To 12 Step 2
Beep
Next intLoop2
3.
For intLoop3 = 2 To 12 Step 3
Beep
Next intLoop3
4.
For intLoop4 = 13 To 3 Step -2
Beep
Next intLoop4
5.
For intLoop5 = 0 To 6 Step 2
Beep
Next intLoop5
6.
For sngLoop6 = 10 To 12 Step 0.5
Beep
Next sngLoop6
7.
For intLoop7 = 3 To Len("Wyomissing")
Beep
Next intLoop7