有如下VB程序段:
For i =" 1" To 6
a(i) =" Int(Rnd" * 10) + 1
Next i
For i =" 1" To 5
If i Mod 2 =" 1" And a(i) > a(i + 1) Then
t =" a(i)" : a(i) =" a(i" + 1) a(i + 1) = t
Else
a(i) =" a(i)" + 1
End If
Next i
执行该程序段后,a(l)~a(6)各元素可能的值是
A.11,11,7,9,3,9B.6,2,8,10,5,9
C.6,9,3,7,8,12D.3,9,0,8,2,7
当前题号:1 | 题型:选择题 | 难度:0.99
现要求编写VB程序,界面如图1所示。程序功能如下:在文本框Text1中输入身份证号码,单击“识别”按钮Command1,在标签Label3中输出对应的性别。
具体方法为:
<1.若身份证号为15位,则根据第15位数字来判断,若为偶数则性别“女”,否则为“男”;<2.若身份证号为18位,则根据第17位数字来判断,若为偶数时则性别为“女”,否则为“男”。

⑴   应用程序界面设计时,为添加“识别”按钮,应使用图2中“控件工具箱”中的_____________(填写相应编号),并修改图3“属性窗口”中,将_____________属性值设置为“识别”

⑵   请根据题意将下列程序补充完整
Dim x As String, n As Integer, s As String
x = Text1.Text
n = Len(x)
If n = 15 Then
s = Mid (_____, Len(x), 1)
If Val(s) Mod 2 <> 0 Then   '判断第15位数字偶数则性别“女”,否则为“男”
Text2.Text = "女"
Else
Text2.Text = "男"
End If
Else
s=Mid(x, 17, 1)     
If __________ Then   
Text2.Text = "男"
Else
Text2.Text = "女"
End If
End If
(3)上述程序中带框框的语句有错,应改为____________________________
当前题号:2 | 题型:None | 难度:0.99
Visual Basic规定窗体文件的扩展名是 (    )
A.fer
B.frm
C.vbp
D.bas
当前题号:3 | 题型:选择题 | 难度:0.99
(加试题)某校举行班班有歌声比赛,参赛班级的成绩按照班级序号保存在“bbygs.accdb”数据库文件中,为了快速计算每个班级最终的分,设计了一个VB程序,该程序能够将8个评委的打分按照从高到低的顺序排序,然后去掉一个最高分和一个最低分,最后计算平均值作为参赛班级的成绩。程序界面如图:单击“提取”按钮Command1,在列表框list1中显示班级序号和该班级8个评委的打分成绩,单击“排序”按钮Command2后,在列表框list2中按降序排序。单击计算得分按钮Command3,在文本框text1中显示最终成绩。按此要求编写程序如下:
Dim class(1 To 30) As Integer '存放班级序号的数组定义为class
Dim score(1 To 8) As single '存放班级各评委打分的数组定义为score
Private Sub Form_load() '提取某班级的评委打分
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Provider=Microsoft.AC
A.OLEDB.12.0;Data Source=" + App.Path + "\bbygs.accdb "
conn.Open
Set rs.ActiveConnection = conn
rs.Open "SELECT * FROM score " 
n = 0
Do While Not rs.EOF   '到最后一条记录后退出循环
n = n + 1
class (n) = rs.Fields("班级序号").Value
score (n) = rs.Fields("评委打分").Value
rs.MoveFirst '① 指针移动到下一条记录
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
for i=1 to n
List1.AddItem str(score(i))
Next i
End sub
Private Sub Command1_Click()  
Dim i as integer
Dim j as integer
Dim t as single

For i=1 to 8
List2.AddItem str(score(i))
Next i
End sub
Private Sub Command2_Click()   '计算班级平均得分
Dim i As Integer
Dim sum As single
For i=2 to 7
sum=sum+score(i)
Next i
Text1.text=  
End sub
(1)程序中①划线处有错,应改为____________________。
(2)加矩形框处的程序所采用的算法是_____________排序。
(3)程序中②划线处应填入___________,程序中③划线处应填入___________。
当前题号:4 | 题型:填空题 | 难度:0.99
有如下VB 程序段:
m = Val(Text1.Text)
Do While m <> 0
x = m Mod 8
m = m \ 8
a(x) = a(x) + 1
If a(x) = 1 Then n = n + 1
Loop
数组a 各元素的初始值都为0,在文本框Text1中输入“529”,执行程序后,变量n的值为()
A.1B.2C.3D.4
当前题号:5 | 题型:选择题 | 难度:0.99
用VB编写“提取字符串”的程序,实现如下功能:在文本框Text1中输入字符串,单击“提取”按钮Command1,程序将字符串中连续最长的大写字母提取出来,并显示在文本框Text2中。程序运行界面如图所示。

(1)程序运行时,要使按钮Command1标题显示“提取”,可在Form_Load()事件处理过程中添加语句_______(单选,填字母:
A.Command1 ="提取"/B.Command1.Text="提取"/C.Command1.Caption = "提取")。
(2)实现上述功能的VB程序如下,请在划线处填入合适代码。
Private Sub Command1_Click()
Dim s As String, d As Integer, i As Integer
Dim max As Integer, c As String, ans As String
s = Text1.Text
d = 0 : max =0
For i = 1 To Len(s)
c = Mid(s, i, 1)
If c >= "A" And c <= "Z" Then
d = d + 1
Else
If d > max Then
ans= Mid(s, i - d, d)

________________

   End If
d = 0
End If
Next i
Text2. Text= ___________
End Sub
(3)若文本框Text1中输入内容为:“Is it JUNE or JULY?”,单击“提取”按钮后,文本框Text2中显示的内容是_________。
当前题号:6 | 题型:填空题 | 难度:0.99
(加试题)若数组元素d(1)到d(8)的值依次为“86,75,58,46,20,18,12,5”,查找某Key值的VB程序段如下:
n = 0 : i = 1 : j = 8
Key = Val(Text1.Text)
Do While i <= j
m = (i + j) \ 2     
If Key = d(m) Then  Exit Do   'Exit Do表示退出循环
If Key > d(m) Then
j = m - 1 : n = n - 1
Else
i = m + 1 : n = n + 1
End If
Loop
Label1.Caption = Str(n)
当输入不同的Key值,运行该程序段后,在标签Label1中显示的不同结果共有
A.5种B.6种C.7种D.8种
当前题号:7 | 题型:选择题 | 难度:0.99