VB 编制打字练习程序。首先单击“产生”,在文本框1随机产生一串大写字母,在文本框2,练打字键入……
编制打字练习程序。首先单击“产生”,在文本框1随机产生一串大写字母,在文本框2,练打字键入同样字母,边键入边统计时间和准确率。...
编制打字练习程序。首先单击“产生”,在文本框1随机产生一串大写字母,在文本框2,练打字键入同样字母,边键入边统计时间和准确率。
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
展开全部
Dim s$, t%
Private Sub Command1_Click()
Dim a%
For i = 1 To 50
a = Int(Rnd * 26 + 65)
s = s + UCase(Chr(a))
Next
Text1 = s
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Text1 = "": Text2 = "": Text3 = "": Text4 = ""
End Sub
Private Sub Text2_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static p!, sum%, m%
t = t + 1
Text3 = t
m = Len(Text2)
sum = 0
For i = 1 To m
If Mid(Text2, i, 1) = Mid(s, i, 1) Then
sum = sum + 1
p = sum / m
Text4 = p * 100 & "%"
End If
Next
End Sub
Private Sub Command1_Click()
Dim a%
For i = 1 To 50
a = Int(Rnd * 26 + 65)
s = s + UCase(Chr(a))
Next
Text1 = s
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Text1 = "": Text2 = "": Text3 = "": Text4 = ""
End Sub
Private Sub Text2_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static p!, sum%, m%
t = t + 1
Text3 = t
m = Len(Text2)
sum = 0
For i = 1 To m
If Mid(Text2, i, 1) = Mid(s, i, 1) Then
sum = sum + 1
p = sum / m
Text4 = p * 100 & "%"
End If
Next
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询