You are create a simple “game” which prompts a user to enter a guess for a secret number (1-10 preset in code)

The following algorithm must be implemented, notify if the number is too low, too high, or accurate. The loop must continue until the correct value is entered. You essentially need to make an infinite loop that as long as the correct guess isn't entered in the Inputbox - the game continues.

You can either use a standard while loop and just not increment the counter variable, or you could test the guess value for not being equal to the secret number, If you use the first method you will add a test for equality and if they are equal call Exit While to break the loop and then tell the user they won.
Notifications of too high, low, or correct should be shown with msgbox commands.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Module Module1

    Sub Main()
       Dim rnd As New Random
       ' generate a number
       Dim secretNumber As Integer = rnd.Next(1, 10)
       Dim number As Integer = 0

       ' loop until we got that secret number
       While number <> secretNumber...

By purchasing this solution you'll be able to access the following files:

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Visual Basic Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats