题型:填空题 题类:常考题 难易度:普通
浙教版信息技术基础期末练习卷
实现上述功能的VB程序如下,但加框处代码有错,请改正。
Private Sub Command1_Click()
Dim s As String,i As Integer,s1 As String,sum As Integer,t As Integer
Dim jy As Integer
s=Text1.Text
t=0:sum=0
For i=1 To Len(s)
s1=Mid(s,i,1)
If s1>=“0” And s1<=“9” Then
′①
If t<10 Then
sum=sum+Val(s1)*(11-t)
ElseIf t=10 Then
′②
End If
End If
Next i
sum=11-sum Mod 11
If Then′③
Text2.Text=“该校验码中数字不是10位数!”
Else
If jy=“X” and sum=10 Then
Text2.Text=“校验通过”
ElseIf val(jy)=sum then
Text2.Text=“校验通过”
Else
Text2.Text=“校验不通过”
End If
End If
End Sub
划线处代码为①
②
③
试题篮