试题 试卷
题型:综合题 题类:常考题 难易度:普通
浙江省诸暨市牌头中学2017-2018学年高二下学期信息技术第一次月考试题
Private Sub Command1_Click()
Dim x As Integer, y As Integer
Dim i As Integer, j As Integer
x=val(text1.text)
i=x \ 10
_____________ ①
y=j*10+i
Text1.Text = y ②
End Sub
a = "360"
b = Val(a)
c = Len(a)
If b > c Then
Label1.Caption = "取数值"
Else
Label1.Caption = "取字符"
End If
该程序段运行后,在标签Label1上显示的是{#blank#}1{#/blank#}。
Dim t As Single, h1 As Single, h2 As Single
Const g = 9.8
t = Val(Text1.Text)
h1 = (g * t ^ 2) / 2
h2 = Int(h1)
Text2.Text = Str(h2)
Dim a As Integer
a = Val(Text1.Text)
Text1.Text = Str(Sqr(a))
程序运行时,单击命令按钮Command1后弹出如图所示的错误信息提示。出现错误的原因可能是( )
实现上述功能的VB程序如下,但加框处代码有错,请改正。
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
′②
Next i
sum=11-sum Mod 11
If Then′③
Text2.Text=“该校验码中数字不是10位数!”
If jy=“X” and sum=10 Then
Text2.Text=“校验通过”
ElseIf val(jy)=sum then
Text2.Text=“校验不通过”
划线处代码为①{#blank#}1{#/blank#}
②{#blank#}2{#/blank#}
③{#blank#}3{#/blank#}
k=1
while 1:
k+=1
试题篮