Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5 short questions 1.Write a Visual Basic Do clause that processes the loop instr

ID: 3564939 • Letter: 5

Question

5 short questions

1.Write a Visual Basic Do clause that processes the loop instructions as long as the value
in the intTotal variable is greater than the number 0. Use the While keyword. Now
rewrite the Do clause using the Until keyword.
2. Write a Visual Basic Do clause that stops the loop when the value in the intQuantity
variable is less than or equal to the value in the intOrdered variable. Use the Until
keyword. Now rewrite the Do clause using the While keyword.
3. Write a Visual Basic Loop clause that processes the loop instructions as long as the
value in the strAnswer variable is either Y or y. Use the While keyword. Now rewrite
the Loop clause using the Until keyword.
4. Write a Visual Basic Do clause that processes the loop instructions as long as the value
in the strState variable is not

Explanation / Answer

' I included the variable declarations so you could check my work

' 1A:
dim intTotal = 1
Do While intTotal > 0
' insert commands here
' EXAMPLE:
Console.WriteLine(intTotal)
intTotal = intTotal-1
Loop
' 1B:
intTotal = 2
Do Until intTotal <= 0
' insert commands here
' EXAMPLE:
Console.WriteLine(intTotal)
intTotal = intTotal-1
Loop
' 2a:
dim intOrdered = 3
intTotal = 4
Do Until intTotal <= intOrdered
' insert commands here
' EXAMPLE:
Console.WriteLine(intTotal)
intTotal = intTotal-1
Loop
' 2b:
intTotal = 4
Do While intTotal > intOrdered
' insert commands here
' EXAMPLE:
Console.WriteLine(intTotal)
intTotal = intTotal-1
Loop
' 3a:
dim strAnswer = "y"
Do While strAnswer ="Y" OR strAnswer ="y"
' insert commands here
' EXAMPLE:
Console.Writeline(strAnswer)
strAnswer = "n"
Loop
' 3b:
strAnswer = "y"
Do Until Not(strAnswer ="Y" OR strAnswer ="y")
' insert commands here
' EXAMPLE:
Console.Writeline(strAnswer)
strAnswer = "n"
Loop
' 4a:
dim strState = "not Finished"
Do While Not(strState.ToLower() = "finished")
' insert commands here
' EXAMPLE:
Console.Writeline(strState)
strState = "Finished"
Loop
' 4b:
strState = "not Finished"
Do Until strState.ToLower() = "finished"
' insert commands here
' EXAMPLE:
Console.Writeline(strState)
strState = "Finished"
Loop

' 5

'it would result in 4 message boxes reading "0","1","2", and "3"

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote