"Jack Higgs" <ja*******@urmom.com> wrote in message
news:5i*******************@news-text.cableinet.net...
Has anyone got any ideas how I could go about producing a maths
program for Primary School pupils? The coding isn't such a problem (ie random
numbers etc), it's acctually figuring out how to interface it or what objects
to use where etc.
I am having two or more random numbers up to say 20 displayed on the
screen and I want the child to be able to fill in the answer (txt box
obviosly). What can I use to display and use the sum in coding?
Cheers,
Jack
Just an idea here. Lots of variations are possible.
This needs a form with three labels, a text box, and a button.
Option Explicit
Private mA As Long
Private mB As Long
Private Sub Form_Load()
Randomize
End Sub
Private Sub Command1_Click()
mA = CLng(Rnd * 20 + 1)
mB = CLng(Rnd * 20 + 1)
Label1.Caption = mA
Label2.Caption = mB
Label3.Caption = ""
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Text1_Change()
If IsNumeric(Text1.Text) Then
If CLng(Text1.Text) = mA + mB Then
Label3.Caption = "You are right!"
End If
End If
End Sub