Answer to Question #195595 in Visual Basic for Nadiah

Question #195595

Identify and correct the error(s) in the following (you may simply need to add code):

Assume that y and total are declared as Integers

total = 0

Do Until y = -1

Print y

y = InputBox(“Enter a value, value input”)

total = total + y

Loop


1
Expert's answer
2021-05-19T14:58:11-0400
Module Module1


    Sub Main()
        Dim total As Integer = 0
        Dim y As Integer = 0
        Do Until y = -1
            Console.WriteLine(y.ToString())
            y = InputBox("Enter a value, value input")
            total = total + y
        Loop
        Console.WriteLine(total.ToString())
    End Sub


End Module

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