Answer to Question #268004 in Visual Basic for ray

Question #268004

3.    Study the following code. what messages will be displayed in the message box?

 Dim intCounter As Integer

 Dim dblSum As Double, dblNumber As Double

 dblSum = 0

 intCounter = 1

 Do While intCounter < 6

 dblSum = dblSum + Convert.ToDouble(intCounter)

 If intCounter Mod 3 = 0 Then

 dblNumber = 5.0

 End If

 dblSum = dblSum + dblNumber

 intCounter = intCounter + 2

 Loop

 MessageBox.Show("The Sum is: " & dblSum.ToString(),"IS122")

4.    Rewrite the following section of code using a For Next loop instead of a Do While loop.

 Dim intSum As Integer

 int intCount As Integer

 intCount = -5

 Do While intCount <= 15  

 intSum = intSum + intCount 

 intCount = intCount + 1

 Loop



1
Expert's answer
2021-11-23T05:28:29-0500
Question 3:
Answer:
The messages will be displayed in the message box:
The Sum is: 19


Question 4:
Answer:


 Dim intSum As Integer
 Dim intCount As Integer
 For intCount = -5 To 15
      intSum = intSum + intCount
 Next

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS