Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-04-2006, 01:41 PM   #1 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 1

Chris-Steel

Default Help with Vb Task

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.
Chris-Steel is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On