CristianoGZ - 2007-4-6 1:41:00
算术CAI。随机出五道题,测试三位数乘法。做对一题给20分,做错不给分,每算一题,输出累计得分、测试可以循环进行。
CristianoGZ - 2007-4-6 23:14:00
各位帮帮手拉!
TsunamiGZ - 2007-4-17 22:57:00
TsunamiGZ - 2007-4-17 22:59:00
以下是代码:
Dim i As Integer
Dim Fs As Integer
Dim a As Long
Dim b As Long
Dim c As Variant
Private Sub Command1_Click()
Form1.Text7.Text = i
If Form1.Text3.Text = c Then
Form1.Text4.Text = "正确"
Form1.Text5.Text = Form1.Text5.Text + 20
Else
Form1.Text4.Text = "错误"
End If
ClearText
i = i + 1
If i < 6 Then
SetExpression
Else
Form1.Command1.Enabled = False
Form1.Command2.Enabled = True
Form1.Command3.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Randomize
i = 1
Fs = 0
Form1.Command2.Caption = "继续测试"
Form1.Command2.Enabled = False
Form1.Command3.Enabled = False
Form1.Command1.Enabled = True
Form1.Text3.Enabled = True
Form1.Text5.Text = Fs
SetExpression
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
ClearText
Form1.Text4.Text = ""
Form1.Text5.Text = ""
Form1.Text7.Text = ""
Form1.Command1.Caption = "打 分"
Form1.Command2.Caption = "开始测试"
Form1.Command3.Caption = "退 出"
Form1.Text1.Enabled = False
Form1.Text2.Enabled = False
Form1.Text3.Enabled = False
Form1.Text4.Enabled = False
Form1.Text5.Enabled = False
Form1.Text6.Enabled = False
Form1.Text7.Enabled = False
End Sub
Private Sub SetExpression()
Form1.Text6.Text = i
a = 0
b = 0
Do While a < 100 Or a >= 1000
a = 1000 * Rnd()
Loop
Do While b < 100 Or b >= 1000
b = 1000 * Rnd()
Loop
Form1.Text1.Text = a
Form1.Text2.Text = b
c = a * b
Form1.Text3.SetFocus
End Sub
Private Sub ClearText()
Form1.Text1.Text = ""
Form1.Text2.Text = ""
Form1.Text3.Text = ""
Form1.Text6.Text = ""
End Sub
编程小学生 - 2007-5-5 18:49:00
编程小学生 - 2007-5-5 18:49:00
Dim n As Integer, fen As Integer
Private Sub Combo1_Click()
Combo1.SelStart = Len(Combo1.Text)
n = Combo1.ListIndex
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
Dim chenghao As Integer, chengshu As String, beichengshu As String, fuhao As Integer, deshu As String
If KeyAscii = 13 Then
chenghao = InStr(1, Combo1.Text, "×")
chengshu = Left(Combo1.Text, chenghao - 1)
fuhao = InStr(1, Combo1.Text, "=")
beichengshu = Mid(Combo1.Text, chenghao + 1, 1)
deshu = Right(Combo1.Text, Len(Combo1.Text) - fuhao)
If Val(chengshu) * Val(beichengshu) = Val(deshu) Then
fen = fen + 20
Label2.Caption = CStr(fen)
End If
Combo1.AddItem Combo1.Text
Combo1.RemoveItem n
Combo1.SelStart = Len(Combo1.Text)
Combo1.SetFocus
Combo1.ListIndex = 0
End If
End Sub
Private Sub Command1_Click()
Dim chengshu As Integer, beichengshu As Integer, i As Integer, a As Integer
Combo1.Clear
For i = 1 To 5
a = 899
Randomize
chengshu = Rnd * a + 100
Randomize
beichengshu = Rnd * a + 100
Combo1.AddItem chengshu & "×" & beichengshu & "="
Next i
Combo1.SelStart = Len(Combo1.Text)
Combo1.SetFocus
Combo1.ListIndex = 0
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Label2.Caption = "0"
End Sub
编程小学生 - 2007-5-5 18:55:00
- 2007-5-6 18:36:00
哇这里这么多人会编程啊
看来这里所有的斑竹都知道啊,还有厉害的哦!
© 2000 - 2026 Rising Corp. Ltd.