当前位置:编程学习 > C#/ASP.NET >>

VB\希望我在这可以找到答案

10.设计一个简单的答题系统,程序运行时要求有以下功能:
1、 按Command1(出题)后随机生成两个两位正整数存入模块级变量a、b且a>b,并分别在Label1、Label2中显示,此后Command1不可用;
2、 在Text1中输入结果、按回车后,以消息框显示运算正确与否、累计所完成题数以及做错的题数,Command1恢复为可用;
3、 按Command2(退出)后以消息框显示所完成题数以及做错的题数,退出。
【程序】
Dim n As Integer, n_error As Integer
Dim a As Byte, b As Byte, c As Byte
Private Sub Command1_Click()
    a = 10 + Rnd * 89 : b = 10 + Rnd * 89
    If  a < b  then ____________              
    Label1.Caption = a: Label2.Caption = b
    n = n + 1: Text1.Text = "": Command1.Enabled =  _______________ 
    Text1.SetFocus
End Sub
Private Sub Text1_  ______________(KeyAscii As Integer)
    If KeyAscii <> 13 Then              
    If a - b = Val(Text1.Text) Then  ____________
        MsgBox ("回答正确")
    Else
        MsgBox ("回答不正确")
        n_error = n_error + 1
    End If
    Command1.Enabled = True
    Command1.SetFocus
End Sub
Private Sub Command2_Click()
    MsgBox (____________________   )
    End 
End Sub
--------------------编程问答-------------------- up --------------------编程问答-------------------- 你的问题是???? --------------------编程问答-------------------- 额 这是VB.NET 区.... --------------------编程问答-------------------- 1、else
2、false
3、keypress

 If KeyAscii <> 13 Then              
    If a - b = Val(Text1.Text) Then  ____________ 
        MsgBox ("回答正确") 
    Else 
        MsgBox ("回答不正确") 
        n_error = n_error + 1 
    End If 
    Command1.Enabled = True 
    Command1.SetFocus 

估计题目错了

5、“你完成了”& n &“题目,答错了”& n_error &“题目” --------------------编程问答-------------------- 理解不了楼主要表达的意思 --------------------编程问答--------------------
引用楼主 a569141411 的回复:
10.设计一个简单的答题系统,程序运行时要求有以下功能:
1、 按Command1(出题)后随机生成两个两位正整数存入模块级变量a、b且a>b,并分别在Label1、Label2中显示,此后Command1不可用;
2、 在Text1中输入结果、按回车后,以消息框显示运算正确与否、累计所完成题数以及做错的题数,Command1恢复为可用;
3、 按Command2(退出)后以消息框显示所完成题数以及做错的题数,退出。
【程序】
Dim n As Integer, n_error As Integer
Dim a As Byte, b As Byte, c As Byte
Private Sub Command1_Click()
    a = 10 + Rnd * 89 : b = 10 + Rnd * 89
    If  a < b  then ____________             
    Label1.Caption = a: Label2.Caption = b
    n = n + 1: Text1.Text = "": Command1.Enabled =  _______________
    Text1.SetFocus
End Sub
Private Sub Text1_  ______________(KeyAscii As Integer)
    If KeyAscii <> 13 Then ____________
            
    If a - b = Val(Text1.Text) Then 
        MsgBox ("回答正确")
    Else
        MsgBox ("回答不正确")
        n_error = n_error + 1
    End If
    Command1.Enabled = True
    Command1.SetFocus
End Sub
Private Sub Command2_Click()
    MsgBox (____________________  )
    End
End Sub

不要意思真的是我不小心弄错了下划线了,我改了,你再帮我看看。我感激不尽 --------------------编程问答--------------------
引用 4 楼 it_gz_xi 的回复:
1、else
2、false
3、keypress

If KeyAscii <> 13 Then  __________           
    If a - b = Val(Text1.Text) Then  
        MsgBox ("回答正确")
    Else
        MsgBox ("回答不正确")
        n_error = n_error + 1
    End If
    Command1.Enabled = True
    Command1.SetFocus

估计题目错了

5、“你完成了”& n &“题目,答错了”& n_error &“题目”

不好意思了我真的是太粗心了~!
补充:.NET技术 ,  VB.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,