We won;t just do the whole thing for you here at DaniWeb. You must at least attempt to do it yourself and post your code when you get stuck then we will help you get it working.
These questions are obviously designed to demonstrate the basic constructs of structured programming Input, looping and decision making and outputing the result.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Ok first thing put [CODE][\code] (but with CODE in capitals, I have to do lower case otherwise they won't show in the post) tags around code in your posts please, makes it more readable. Thanx.
Ok I think in three what they want you to do is a global variable :
Dim guesses As Integer
guesses = 3
Private Sub Command1_Click()
If Text1.Text = "secret" Then
MsgBox "password is correct"
Exit Sub
Else
guesses = guesses - 1
MsgBox "password is incorrect. " & guesses & " remaining"
End If
If guesses = 0 Then
Me.Unload
End If
End Sub
You should ba able to use similar idea for Q4 keep count of answers in two global integer variables failed and passed, increment them as per each yes and no answer. Add a label to your form and set it's text property to something like Label.text = failed & " People failed, " & passed & " People passed."
I've not got VB6 anymore (I assume that's what you're using as your in Vb forum) So I can't check this code, if you get any errors post them word for word and I'll help best I can. Bear with me I am in a full time job and busy busy.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Is the message box with guesses remaining always say 3 remaining? or what? can you post your code as it now stands please? I'll see if I can work out your problem.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Your new at this aren't you.:) come on paste the code I wanna fix it.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68