Help with Vb Task

Status
Not open for further replies.

Chris-Steel

Beta member
Messages
1
Hello im wondering if anyone could help me i have an assesment on Visual Basic i'm using version 6.0.
I am new to programming.

Anyway this is the description of my task:

"A program is require to prompt the user to guess a randomly chosen whole number between 1 and 20. The input should be validated. If the guess is incorrect, the user should be told if the target number is bigger or smaller. This process should continue until the target number is guessed correctly. The user should then be told how many valid guessed were made."

This is what i have so far, im using two text boxes, one for the user to input their guess and one for feedback on how they are doing.

Dim counter As Integer
Dim guess As Integer
Dim number As Integer
counter = 0
'Generate the Random Number
number = Int(Rnd1 - 20)
If guess > number Then
txtfeedback = "Your guess is too high up please try again"
ElseIf guess < number Then
txtfeedback = "Your guess is too low please try again"
ElseIf guess = number Then
txtfeedback = "Your guess is Correct, WELL DONE!"

Any Help would be appreciated.
 
Status
Not open for further replies.
Back
Top Bottom