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

6) An InputBox returns a string - whatever the user enters in the box. However,

ID: 3673846 • Letter: 6

Question

6) An InputBox returns a string - whatever the user enters in the box. However, it returns a blank string if the user enters nothing and clicks on OK or on Cancel.
Write a sub that uses an InputBox to ask the user for a product code. Embed this in a Do Loop so that the user has to keep trying until the result is not a blank string.

8) In exercise 6, you chose one of the four possible versions of Do loops in your code; using a While or Until condition, and placing the condition at the top of the loop or the bottom of the loop. Regardless of how you did it, rewrite your sub in each of the three other possible ways.

Explanation / Answer

6)

Private Sub DoWhileForStrNoStr(ValBy ip As String)

Do While ip = String.Empty
MessageBox.Show("Nothing Entered", "Nothing Entered")
Exit Sub
Loop
End Sub

8)

Note: Problem statement is not correctly menctioned:

8) In exercise 6, you chose one of the four possible versions of Do loops in your code.

But you did not provid any exercise 6: possible versions.

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