返回首页

欢迎光临本站!    

做题+继续做题+还是做题=通过二级
全国计算机等级考试 历年真题 2007年4月计算机等级考试二级VB考前密卷(1)

一、选择题(每题2分,共计70分)

1.在深度为5的满二叉树中,叶子结点的个数为
A) 32
B) 31
C) 16
D) 15
A       B       C       D      
2.若某二叉树的前序遍历访问顺序是abdgcefh,中序遍历访问顺序是dgbaechf,
则其后序遍历的结点访问顺序是
A) bdgcefha
B) gdbecfha
C) bdgaechf
D) gdbehfca
A       B       C       D      
3.一些重要的程序语言(如C语言和Pascal语言) 允许过程的递归调用。
而实现递归调用中的存储分配通常用
A) 栈
B) 堆
C) 数组
D) 链表
A       B       C       D      
4.软件工程的理论和技术性研究的内容主要包括软件开发技术和
A) 消除软件危机
B) 软件工程管理
C) 程序设计自动化
D) 实现软件可重用
A       B       C       D      
5.开发软件时对提高开发人员工作效率至关重要的是
A) 操作系统的资源管理功能
B) 先进的软件开发工具和环境
C) 程序人员的数量
D) 计算机的并行处理能力
A       B       C       D      
6.在软件测试设计中,软件测试的主要目的是
A) 实验性运行软件
B) 证明软件正确
C) 找出软件中全部错误
D) 发现软件错误而执行程序
A       B       C       D      
7.数据处理的最小单位是
A) 数据
B) 数据元素
C) 数据项
D) 数据结构
A       B       C       D      
8.索引属于
A) 模式
B) 内模式
C) 外模式
D) 概念模式
A       B       C       D      
9.下述关于数据库系统的叙述中正确的是
A) 数据库系统减少了数据冗余
B) 数据库系统避免了一切冗余
C) 数据库系统中数据的一致性是指数据类型一致
D) 数据库系统比文件系统能管理更多的数据
A       B       C       D      
10.数据库系统的核心是
A) 数据库
B) 数据库管理系统
C) 模拟模型
D) 软件工程
A       B       C       D      
11.下列说法错误的是
A) 窗体文件的扩展名为.frm
B) 一个窗体对应一个窗体文件
C) Visual Basic中的一个工程只包含一个窗体
D) Visual Basic中一个工程最多可以包含255个窗体
A       B       C       D      
12.下列四组控件属性中,属性值的类型不相同的一组是
A) Label控件的Enabled属性与TextBox控件的Enabled属性
B) OptionButton控件的Value属性与CheckBox控件的Value属性
C) Command控件的Default属性与Command控件的Cancel属性
D) Command控件的Visible属性与Form控件的Visible属性
A       B       C       D      
13.下列方法中不能退出Visual Basic的是
A) 按Alt+Q组合键
B) 按下Alt+F组合键,然后按Esc键
C) 打开"文件"菜单,执行"退出"命令
D) 按F10键,然后按F键,再按X键
A       B       C       D      
14.任何控件都有的属性是
A) BackColor
B) Caption
C) Name
D) BorderStyle
A       B       C       D      
15.可以实现从键盘输入一个作为双精度变量a的值的语句是
A) a=InputBox()
B) a=InputBox("请输入一个值")
C) a=Val(InputBox("请输入一个值") )
D) a=Val(InputBox() )
A       B       C       D      
16.下列符号常量的声明中,不合法的是
A) Const a As Single=1.1
B) Const a="OK"
C) Const a As Double=Sin(1)
D) Const a As Integer="12"
A       B       C       D      
17.在Visual Basic中,要强制用户对所用的变量进行显式声明,这可以在哪里设置?
A) "属性"对话框
B) "程序代码"窗口
C) "选项"对话框
D) 对象浏览器
A       B       C       D      
18.下列语句中,获得列表框List1中项目个数的语句是
A) x=List1.ListCount
B) x=ListCount
C) x=List1.ListIndex
D) x=ListIndex
A       B       C       D      
19.要获得当前驱动器应使用驱动器列表框的属性是
A) Path
B) Drive
C) Dir
D) Pattern
A       B       C       D      
20.如果将文本框的MaxLength属性设置为0,则文本框中的字符不能超过
A) 8K
B) 16K
C) 32K
D) 64K
A       B       C       D      
21.当在滚动条内拖动滚动块时触发
A) KeyUp事件
B) KeyPress事件
C) Scroll事件
D) Change事件
A       B       C       D      
22.设有声明语句
Dim b(-1 To 10, 2 To 9, 20) As Integer
则数组b中全部元素的个数
A) 2310
B) 2016
C) 1500
D) 1658
A       B       C       D      
23.设在窗体上有个文本框,然后编写如下的事件过程:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Const Alt=4
Const Key_F2=&H71
altdown%=(Shift And Alt) > 0
f2down%=(KeyCode=Key_F2)
If altdown% And f2down% Then
Text1.Text="BBBBB"
End If
End Sub
上述程序运行后,如果按 【Shift+F2】 ,则在文本框中显示得是
A) Alt+F2
B) BBBBB
C) 随机出几个数
D) 文本框平均内容无变化
A       B       C       D      
24.设已经在"菜单编辑器"中设计了窗体的快捷菜单,其顶级菜单为Bs,
取消其"可见"属性,运行时,在以下事件过程中,可以使快捷菜单
响应鼠标右键菜单的是
A) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If Button=2 Then PopupMenu Bs, 2
End Sub
B) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
PopupMenu Bs
End Sub
C) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
PopupMenu Bs,0
End Sub
D) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If (Button=vbLeftButton) Or (Button=vbRightButton) Then PopupMenu Bs
End Sub
A       B       C       D      
25.设已经在"菜单编辑器"中设计了窗体的快捷菜单,其顶级菜单为Bs,取消其"可见"属性,
运行时,在以下事件过程中,可以使快捷菜单响应鼠标右键菜单的是
A) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If Button=2 Then PopupMenu Bs, 2
End Sub
B) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
PopupMenu Bs
End Sub
C) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
PopupMenu Bs,0
End Sub
D) Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If (Button=vbLeftButton) Or (Button=vbRightButton) Then PopupMenu Bs
End Sub
A       B       C       D      
26.要将名为MyForm的窗体显示出来,正确的使用方法是
A) MyForm.Show
B) Show.MyForm
C) MyForm Load
D) MyForm Show
A       B       C       D      
27.下列程序段的执行结果为
a=5
For k=1 To 0
a=a + k
Next k
Print k; a
A) -1 6
B) -1 16
C) 1 5
D) 11 21
A       B       C       D      
28.下列程序段的执行结果为
a=3
b=1
For I=1 To 3
f=a + b
a=b
b=f
Print f
Next I
A) 4 3 6
B) 4 5 9
C) 6 3 4
D) 7 2 8
A       B       C       D      
29.下列程序段的执行结果为
I=9
x=5
Do
I=I + 1
x=x + 2
Loop Until I >=7
Print "I="; I
Print "x="; x
A) I=4x=5
B) I=7x=15
C) I=6x=8
D) I=10x=7
A       B       C       D      
30.以下程序段运行时从键盘上输入字符"-",则输出结果为
op$=InputBox("op=")
If op$="+" Then a=a + 2
If op$="-" Then a=a - 2
Print a
A) 2
B) -2
C) 0
D) +2
A       B       C       D      
31.以下程序段的输出结果为
Dim l, a(10) , p(3)
k=5
For i=0 To 10
a(i) =i
Next i
For i=0 To 2
p(i) =a(i  (i + 1) )
Next i
For i=0 To 2
k=k + p(i)  2
Next i
Print k
A) 20
B) 21
C) 56
D) 32
A       B       C       D      
32.下列程序的执行结果为
Private Sub Command1_Click()
Dim x As Integer, y As Integer
x=12: y=20
Call Value(x, y)
Print x; y
End Sub
Private Sub Value(ByVal m As Integer, ByVal n As Integer)
m=m * 2: n=n - 5
Print m; n
End Sub
A) 20 12
20 15
B) 12 20
12 25
C) 24 15
12 20
D) 24 12
12 15
A       B       C       D      
33.在窗体上画一个命令按钮,然后编写下列程序
Private Sub Command3_Click()
Tcl 2
Tcl 3
Tcl 4
End Sub
Sub Tcl(a As Integer)
Static x As Integer
x=x + a
Print x;
End Sub
程序运行后,单击命令按钮,输出结果为
A) 2 3 4
B) 2 5 9
C) 3 5 4
D) 2 4 3
A       B       C       D      
34.下面程序段,运行后的结果是Private Sub Command1_Click()
Dim b%(1 To 4) , i%, t#
For i=1 To 4
b(i) =i
Next i
t=Tof(b() )
Print "t="; t,
End Sub
Function Tof(a() As Integer)
Dim t#, i%
t=1
For i=2 To UBound(A)
t=t * a(i)
Next i
Tof=t
End Function
A) t=18
B) t=24
C) t=30
D) t=32
A       B       C       D      
35.单击按钮时,以下程序运行后的输出结果是
Private Sub Command1_Click()
Dim x As Integer, y As Integer, z As Integer
x=1: y=2: z=3
Call God(x, x, z)
Print x; x; z
Call God(x, y, y)
Print x; y; y
End Sub
Private Sub God(x As Integer, y As Integer, z As Integer)
x=3 * z + 1
y=2 * z
z=x + y
End Sub
A) 6 6 12
7 11 11
B) 8 5 10
5 11 11
C) 9 6 12
9 10 15
D) 8 10 10
5 9 10
A       B       C       D      

二、填空题(每空2分,共计30分)

1.在树结构中,树根结点没有 【1】 。
输入答案,中间不含空格:
2.Jackson结构化程序设计方法是英国的M.Jackson提出的,它是一种面向 【2】 的设计方法。
输入答案,中间不含空格:
3.面向对象的模型中,最基本的概念是对象和 【3】 。
输入答案,中间不含空格:
4.软件设计模块化的目的是 【4】 。
输入答案,中间不含空格:
5.数据模型按不同应用层次分成3种类型,它们是概念数据模型、 【5】 和物理数据模型。
输入答案,中间不含空格:
6.在Visual Basic的立即窗口内输入以下语句
X=65<CR>
?Chr$(X) <CR>
在窗口中显示的结果是 【6】 。
输入答案,中间不含空格:
7.下列程序是判断一个整数(>=3) 是否为素数,请补充完整。
Dim n As Integer
n=InputBox("请输入一个整数(>=3) ")
k=Int(Sqr(n) )
i=2
swit=0
While i <=k And swit=0
If n Mod i=0 Then
【7】
Else
【8】
End If
Wend
If swit=0 Then
Print n; "是一个素数。"
Else
Print n; "不是一个素数。"
End If

输入答案,中间不含空格:
8.上一题【8】
输入答案,中间不含空格:
9.
下面程序是用来打印九九乘法表的,请补充完整。
Dim i As Integer, j As Integer, Str1$
Str1=""
For i=1 To 9
For j=1 To 9
If 【9】 Then
Str1=Str1 + Str$(j) + "×" + Str$(i) + "=" + Str$(Val(i  j) )
Else
Str1=Str1 & Chr(13)
【10】
End If
Next j
Next i
Print Str1
输入答案,中间不含空格:
10.上一题【10】
输入答案,中间不含空格:
11.在窗体上有一个命令按钮,然后编写如下程序:
Function Trans(ByVal num As Long) As Long
Dim k As Long
k=1
Do While num
k=k * (num Mod 10)
num=num \ 10
Loop
Trans=k
Print Trans
End Function
Private Sub Command1_Click()
Dim m As Long
Dim s As Long
m=InputBox("请输入一个数")
s=Trans(m)
End Sub
程序运行时,单击命令按钮,在输入对话框中输入"789",输出结果为 【11】 ,在输入
对话框中输入"987"输出 【12】 ,在输入对话框中输入"879",输出结果为 【13】 。
输入答案,中间不含空格:
12.上一题【12】
输入答案,中间不含空格:
13.上一题【13】
输入答案,中间不含空格:
14.下面程序的功能是产生10个小于100(不含100) 的随机正整数,
并统计其中5的倍数所占比例,但程序不完整,请补充完整。
Sub PR()
Randomize
Dim a(10)
For j=1 To 10
a(i) =Int( 【14】 )
If 【15】 Then k=k + 1
Print a(j)
Next j
Print
Print k / 10
End Sub
输入答案,中间不含空格:
15.上一题【15】
输入答案,中间不含空格:
交卷

Hi,亲爱的朋友,欢迎光临Passtwo! 您想做点什么呢?

I Want....

热门软件下载

实用电子地图

本站隆重推荐自主开发的VFP上机模拟系统免费下载使用

二级vfp上机模拟系统 通过二级

Valid XHTML 1.0 Transitional

Valid CSS!