2014年12月计算机等级考试二级VB全真模拟卷一_第4页

考试站(www.examzz.com)   【考试站:中国教育考试第一门户】   2014年10月27日
(31) 不能脱离控件(包括客体) 而独立存在的过程是
A) 事件过程 
B) 通用过程
C) Sub过程 
D) 函数过程
答案:A
(32) Sub过程与Function过程最根本的区别是
A) Sub过程可以用Call语句直接使用过程名调用,而Function过程不可以
B) Function过程可以有形参,Sub过程不可以
C) Sub过程不能返回值,而Function过程能返回值
D) 两种过程参数的传递方式不同
答案: C
(33) 单击命令按钮时,下列程序的执行结果为
Private Sub Command1_Click() 
Dim x As Integer, y As Integer
x=12:y=32 
Call Proc(x,y) 
Print x; y
End Sub
Public Sub Proc(n As Integer, ByVal m As Integer) 
n=n Mod 10
m=m Mod 10
End Sub
A) 1232 
B) 232
C) 23 
D) 123
答案:B
(34) 单击命令按钮时,下列程序的执行结果是
Private Sub Command1_Click() 
Dim a As Integer, b As Integer, c As Integer
a=3
b=4
c=5
Print SecProc(c, b, a) 
End Sub
Function FirProc(x As Integer, y As Integer, z As Integer) 
FirProc=2x+y+3z
End Function
Function SecProc(x As Integer, y As Integer, z As Integer) 
SecProc=FirProc(z, x, y) +x
End Function
A) 20 
B) 22
C) 28 
D) 30
答案:C
(35) 下列程序的执行结果为
Private Sub Command1_Click() 
Dim FirStr As String
FirSt="abcdef"
Print Pat(FirStr) 
End Sub
Private Function Pat(xStr As String) As String
Dim tempStr As String, strLen As Integer
tempStr=""
strLen=Len(xStr) 
i=1
Do While i<=Len(xStr) -3
tempStr=tempStr+Mid(xStr, i, 1) +Mid(xStr, strLen -i+1, 1) 
i=i+1
Loop
Pat=tempStr
End Function
A) abcdef 
B) afbecd
C) fedcba 
D) defabc
正确答案:B 

相关文章