2.小張?jiān)O(shè)計(jì)了一個(gè)“加減運(yùn)算練習(xí)”VB程序.界面如下圖所示.單擊“出題”Command1按鈕顯示兩個(gè)運(yùn)算數(shù)和運(yùn)算符號(hào),并計(jì)數(shù).在文本框Text1中輸入計(jì)算結(jié)果后單擊“判斷”按鈕Command2,如果計(jì)算結(jié)果正確,則得分加10分,直至完成10題測(cè)試.VB程序如下,但加下橫線處代碼有錯(cuò),請(qǐng)改正. Dim n,s As Integer'n為試題計(jì)數(shù)器,s為得分 Dim a,b As Integer'a,b 為兩個(gè)運(yùn)算數(shù) Dim c As String'c為運(yùn)算符:“+“表示加法,“-“表示減法 Private Sub Form_Load( ?。﹏=0: s=0 End Sub Private Sub Command1_Click( )‘出題按鈕 Randomize n=n+1 If n<11Then Label1.Caption=“No:“+Str(n) a=Int(Rnd*100)'a,b為運(yùn)算數(shù),且要求a不小于b b=Int(Rnd*100) If a>bThen t=a:a=b:b=t'(1) If Rnd>0.5Then c=“+“Else b=“-“'(2) Label5.Caption=Str(a)+c+Str(b)+“=“ Text1.Text=““ Else Command1.Caption=“完成測(cè)試“ End If End Sub Private Sub Command2_Click( )‘判斷按鈕 If c=“+“Then If a+b=Val(Text1.Text) Then s=s+10 Else If a+b=Val(Text1.Text)Then s=s+10'(3) End If Label3.Caption=“得分:“+Str(s) End Sub.