Wyo Visual Basic
Ch. 5 Worksheet #3
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 of each variable. Place single slashes through 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
    intCounter1 = intSum + intLoop1
    Beep
Next intLoop1

2.

 intCounter2 = 200

For intLoop2 = 2 To 12 Step 5
     intCounter2 =  intCounter2 - intLoop2
    Beep
Next intLoop2

3.

intCounter3 = 1

For intLoop3 = 2 To 9 Step 3
     intCounter3 = intCounter3 * 2
    Beep
Next intLoop3

4.

For intLoop4 = 10To 3 Step -2
    intCounter4 = 3
    Beep
Next intLoop4

5.

For intLoop5 = 0 To -5 Step -2
    intCounter5 = intCounter5 + intLoop5
    Beep
Next intLoop5

6.

For sngLoop6 = 10 To 12 Step 0.5
    sngLoop6 = 10 + intCounter6

    Beep

Next sngLoop6

7.

For intLoop7 = 1 To Len("Wyo")
    intCounter7 = intCounter7 + 1 * intLoop7

    Beep

Next intLoop7