Loading

VB - What is the output of the code shown below How would you change the code to produce a list box containing the values 12-20

Availability: In stock

$15.00
Already Bought 1 times.

VB - What is the output of the code shown below How would you change the code to produce a list box containing the values 12-20

Quick Overview


  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 = o
For intOuterLoop = 1 to 8
For intInnerLoop = 3 to 7
intADD += 1
Next
Next
MsgBox.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
1stDisplay.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 < 26
intCount -= 2


1stCount.Items.Add (intCount)


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

$15.00

Details

  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 = o
For intOuterLoop = 1 to 8
For intInnerLoop = 3 to 7
intADD += 1
Next
Next
MsgBox.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
1stDisplay.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 < 26
intCount -= 2

1stCount.Items.Add (intCount)

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

Additional Information

Programming Language Visual Basic

Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.