浙江省2019年信息技术选考模拟试卷一
年级: 学科:信息技术(信息科技) 类型: 来源:91题库
一、选择题 (共12小题)
下列说法正确的是( )
下列说法正确的是( )
下列说法正确的是( )
下列说法不正确的是( )
Dim a(1 to 20) As Integer
For i=2 to 10
For j=2 to 20\i
a(i*j)=a(i*j) +1
Next j
Next i
该程序段运行后,数组a中元素值为0的个数是( )
num = 0
For i = 1 To 3
For j = 8 To i + 1 Step -1
If a(j) < = a(i) Then
temp = a(j): a(j) = a(i): a(i) = temp
num = num +1
End If
Next j
Next i
数组元素a(1)到a(8)的值依次为“25,44,16,34,57,25,34,60”,执行该程序段,变量num的值是( )
二、非选择题 (共5小题)
图a
请回答下列问题:
图b
图c
Private Sub Command1_Click()
Dim dx As String, dw As String
Dim st As String, ch As Integer
Dim i ,n As Integer
dx = "零壹贰叁肆伍陆柒捌玖"
dw = "亿仟佰拾萬仟佰拾圆"
st = Text1.Text : n = Len(st)
If n > 9 Then
Text2.Text = "输入的数据超出所能转换的范围"
Else
For i = 1 To n
ch = ①
s = s + Mid(dx, ch + 1, 1) + Mid(dw, ② , 1)
Next i
Text2.Text = s + "整"
End If
End Sub
以上程序段运行时,为了实现上述功能,划线处应填入的代码分别为:
① ; ② ;
场景名:main |
类别序号:2 |
进入方式: 来自“片头”场景,播放结束自动进入 呈现方式: ⒈背景出现的动画方式为淡入,动画时间约1秒 ⒉单击“Go”按钮进入“片尾”场景第1帧开始播放 |
呈现顺序说明: ⒈一开始出现背景、花朵动画 ⒉约2秒后,出现“欢迎您”移动动画 ⒊最后出现“Go”按钮,动画停止 |
请回答下列问题:
图a
图b
图c
图d
分析原因是 。
实现上述功能的VB代码如下,但加框处代码有错,请改正。
Dim a(1 To 20) As Integer ’用于保存n(n<=20)个按从小到大顺序排列的整数
‘Form_Load事件过程产生n个整数,按升序保存在数组a中,并在Text1中显示
Private Sub Form_Load()
‘代码略
End Sub
Private Sub Command1_Click()
Dim i , j , m , k As Integer
Dim x As Integer,f As Boolean ’变量f用于标记是否在数组中找到x
x = Val(Text2.Text)
i=1 :j=n : f=False
Do While i<=j And f=False
m = Fix((i+j)/2)
If a(m)=x Then f=True
If Then i=m+1 Else j=m-1 ‘(1)
Loop
If f = True Then
For k = m To n-1
‘(2)
Next k
n = n - 1
Text3.Text = ""
For k = 1 To n
Text3.Text = Text3.Text+Str(a(k))+","
Next k
Else
Text3.Text = "该数没有找到!"
End If
End Sub
以上程序段运行时,为了实现上述功能,加框处代码应改正为:
⑴ ;⑵ 。
Dim m2 As String
Private Sub Command1_Click()
Dim flag(1 To 26) As Boolean
Dim num As Integer,t As Integer
num = 1
For i = 1 To 26
flag(i) = False
Next i
Do While num <= 26
x = Int(Rnd * 26) + 97
①
If flag(t) = False Then
m2 = m2 + Chr(x)
num = num + 1
②
End If
Loop
Text2.Text = m2
End Sub
Private Sub Command2_Click()
Dim s As String, m As String, result As String
Dim k As String, c As Integer
s = Text3.Text : m = Text1.Text
For i = 1 To Len(s)
k = Mid(s, i, 1)
If k >= "A" And k <= "Z" Then
k = Chr(Asc(k) + 32)
End If
c = 1 : continue = True
Do While continue=True
If k = Mid(m, c, 1) Then
continue = False
End If
c = c + 1
Loop
③
Next i
Text4.Text = result
End Sub
以上程序段运行时,为了实现上述功能,划线处应填入的代码为为:
① ; ② ;③ 。