HUI 57.doc

CLICK HERE TO DOWNLOAD THIS ANSWER INSTANTLY

1. What is the output of the code shown below?
intRate = 12
Do While intRate <= 10
lstDisplay.Items.Add(intRate)
intRate += 1
Loop

2. How would you change the code to produce a list box containing the values 12-20?

3. What is the output of the code shown below?
Dim intADD As Integer
Dim intOuterLoop As Integer
Dim intInnerLoop As Integer
intADD = 0
For intOuterLoop = 1 To 8
For intInnerLoop = 3 To 7
intADD += 1
Next
Next
MessageBox.Show(“The final value is ” & intADD.ToString())

4. What is the output of the code shown below?
Dim intValue As Integer
intValue = 2
Do While intValue <= 9
lstDisplay.Items.Add(intValue & ” ” & intValue ^ 3)
intValue += 2
Loop

5. Fix the errors in the loop shown below:
Dim intStart As Integer = 8
Loop
IntStart = +4
Do While intStart < 24 6. What is the output of the code shown below? intCount = 40 Do Until intCount 10.5D MsgBox (“The cost is now “ & decCost.ToString (“F1”)) decCost -= 0.5 Loop 7. Fix the errors in the code shown below: Dim decCost As Decimal = 3.5D Do Until decCost > 10.5D
MsgBox (“The cost is now “ & decCost.ToString (“F1”))
decCost -= 0.5
Loop

8. In the example shown below, I want the code to count the odd numbers from 1 to 99. What is missing?
Dim intOddNumber As Integer = 1
Do While intOddNumber <= 99
1stDisplay.Items.Add (“Odd numbers: “ & intOddNumber.ToString () )
Loop