浙江省嘉兴市、丽水市2017-2018学年选考信息技术教学测试试卷(3月)
年级: 学科:信息技术(信息科技) 类型: 来源:91题库
一、选择题 (共12小题)
下列说法正确的是( )
下列说法正确的是( )




下列说法正确是( )
下列说法正确的是( )
下列说法正确的是( )
制作完成后分别以a. bmp和b. jpg保存,已知b. jpg文件容量为236 KB,则图像文件a. bmp与b. jpg的压缩比约为( )
Private Sub Command1_Click()
Dim k As Integer,a As Integer,b As Integer
a=Val(Text1.Text)
b=Val(Text2.Text)
Label1.Caption=trans(a,b)
End Sub
Function trans(m As Integer,n As Integer)As String
If m<>0 Then
r=m Mod n
trans=trans(m\n,n)+Str(r)
Else
trans=0
End If
End Function
程序运行时,在文本框Text1和Text2中分别输入11和2,则Label1中的输出结果是( )
Key=Val(Text1.Text)
i=1:j=10
flag=False
s=””
Do While i<一i And NOt flag
mid1=Int(i+(j-i)/3)
mid2=Int(j-(i-i)/3)
If Key=a(mid1)Then
flag=True
ElseIf Key<a(mid1) Then
j=mid1-1
ElseIf Key=a(mid2) Then
flag=True
ElseIf Key>a(mid2) Then
j=mid2+1
Else
i=mid1+1
i=mid2-1
End If
s=s&” ”& mid1 & “:”& mid2
Loop
Text2.Text=s
已知数组a(1 To 10)中的数据分别是12,21,34.45,59,63,72,86,94,100,在文本框Text1中输入34,程序运行后文本框Text2中显示的内容是( )
二、非选择题 (共5小题)
请回答下列问题:
Private Sub Command1_Click()
Dim s As String
Dim m As Integer,n As Integer,k As Integer,t As Integer,i As Integer
s=Text1.Text
n=Len(s)
k=1:m=0:t=0
For i=2 To n
If Mid(s,i,1)> ① Then
k=k+1
t=0
Else
t=1
End If
If k>3 And( ② )Then
m=m+1
k=1
End If
Next i
Text2.Text=Str(m)
End Sub
① ②
实现上述功能的VB程序如下,但加框处代码有错,请改正。
Dim a(0 To 20)As Integer,d(0 To 20)As Integer
Dim n As Integer
Private Sub Command1_Click()
‘产生n个[10,99]之间的随机整数,存储在a(0 To n-1)中,同时显示在List1中,代码略
End Sub
Private Sub Command2_Click()
Dim i As Integer
n=Val(Text1.Text)
For i=0 To n-2
For j=i+1 To n-1
If Then ‘(1)
temp=a(i):a(i)=a(j):a(j)=temp
End If
Next j
Next i
If n Mod 2<>0 Then d(n\2)=a(n-1) ‘个数为奇数,最小值放中间位置
For i=0 To n\2—1
d(i)=a(i*2)
=a(2*i+1) ‘(2)
Next i
‘在列表框List2中输出数组d,代码略
End Sub
明文:HelloWorld
密钥:abcabcabca
密文:HfnlpYosnd
依据上述算法描述设计了如下VB程序。请回答下列问题:
Const MIN_ASC=65 ‘字母”A”的ASCII值
Function x2D(x As String)As String ‘字符串小写转成大写
Dim s As String,zf As String,i As Integer
S=””
For i=1 To Len(x)
zf=Mid(x,i,1)
If zf>=“a”And zf<=“z”Then
s=s+ ①
Else
s=s+ zf
End If
Next
X2D=s
End Function
Private Sub Command1_Click()
Dim M As String,K As String,C As String,flag As Boolean
Dim i As Integer,t As Integer,ch As Integer,pos As Integer·
As Integer
M=Textl.Text ‘明文
K=Text2.Text ‘密钥
t=Len(K)
K=X2D(K) ‘将密钥全部转成大写
C=“ ” ‘加密后的结果
For i=1 To Len(M)
ch=Asc(Mid(M,i,1))
flag=False
If ch>=97 And ch<=122 Then ch=ch-32:flag=True
pos= ② ‘密钥的字符位置值
If pos=0 Then pos=t
j=Asc(Mid(K,pos,1)) ‘密钥字符的ASCII值
ch=ch-MIN_ASC
j=j-MIN_ASC
ch= ③
ch=ch+MIN_ASC
If flag Then ch=ch+32 ‘设置字母的大小写形式
C=C & Chr(ch)
Next i
Text3.Text=C
End Sub
① ② ③