2010年9月计算机等考二级VB真题及答案(8)
发布时间:2021-06-06
发布时间:2021-06-06
真题答案
16
D)出错
104.调用并执行C盘计算器程序,让窗口具有焦点,且会还原到它原来的大小和位置,下列调用方法正确的是 B 。
A)Shell "C:WINDOWS\CALC.EXE",vbHide
B)Shell "C:\WINDOWS\CALC.EXE",vbNormalFocus
C)Shell "C:\WINDOWS\CALC.EXE",vbMinimizedNoFocus
D)Shell "C:\WINDOWS\CALC.EXE",vbNormalNoFocus
105.下列程序输出结果为 B 。
Private Sub Command1_Click()
a%=10
b%=5
Change a,b
Print a,b
End Sub
Private Sub Change(ByVal a As Integer,b As Integer)
Tmp=a
a=b
b=tmp
End Sub
A)5 5
B)10 10
C)10 5
D)5 10
106.下述程序的运行结果是 A 。
Private Sub Command1_Click()
a=1.5
b=1.5
Call fun(a,b)
Print a,b
End Sub
Private Sub fun(x,y)
x=y*y
y=y+x
End Sub
A)2.253.75
B)1.52.25
C)1.50.75
D)0.751.5
107.下述程序的运行结果是 A 。
Private Sub Command1_Click()
Dim a As Integer,b As Integer
a=5
b=5
showValue a,b
End Sub
Sub ShowValue(a As Integer,b As Integer)
calc1 a,b
calc2 a,b
Print a;
Print b
End Sub
Private Sub calc1(a As Integer,b As Integer)
a=a+b
End Sub
Private Sub calc2(a As Integer,b As Integer)
b=a*b
End Sub
A)10 50
B)5 25
C)5 5
D)10 5
108.下列程序运行后,输出的结果是 C 。
Private Sub Command1_Click()
Sum=0
For k=3 To 5
Call Multi(k,s)
Sum=Sum+s
Next k
Print Sum
End Sub
Private Sub Multi(k,s)
s=1
For j=1 To k
s=s*j
Next j
End Sub
A)9
B)120
C)150
D)30
109.下列程序运行后,输出的结果是 B 。
Private Sub Command1_Click()
a=1:b=1
Print "a=";a;",b=";b
Call multi(a,b)
Print "a=";a;",b=";b
End Sub
Private Sub multi(x,y)
x=2*x
y=3*y
Print "x=";x",y=";y
End Sub
A)a=1,b=1
x=2,y=3
a=1,b=1
B)a=1,b=1
x=2,y=3
a=2,b=3
C)a=1,b=1
x=2,y=3
a=1,b=3
D)a=1,b=1
x=2,b=3
a=2,b=1
110.单击一次命令按钮后,下列程序代码的执行结果为 B 。
Private Sub Command1_Click()
Dim m As Integer,i As Integer,x(10)As Integer
For i=0 To 4:x(i)=i+1:Next i
For i=1 To 2:Call Prioc(x):Next i
For i=0 To 4:Print x(i);:Next i
End Sub
Private Sub Prioc(a()As Integer)
Static i As Integer
Do
a(i)=a(i)+a(i+1)
i=i+1
Loop While i<2
End Sub
A)3 4 7 5 6
B)3 5 7 4 5
C)1 2 3 4 5
D)1 2 3 5 7
111.单击一次命令按钮,下列程序代码的执行结果为 A 。
Private Sub Command1_Click()
Dim a As Integer,b As Integer,c As Integer
a=2:b=3:c=4
Print P2(c,b,a)
End Sub
Private Function P1(x As Integer,y As Integer,z As Integer)
P1=2*x+y+3*z
End Function
Private Function P2(x As Integer,y As Integer,z As Integer)
P2=P1(z,x,y)+x
End Function
A)21 B)19 C)17 D)34
112.有如下程序,运行后单击按钮输出的结果是 A 。
Private Sub Command1_Click()
m=5:n=4
Call A(m,n)
Print m,n
End Sub
Private Sub A(m,n)
s=m
m=s/n
n=s Mod n
End Sub
A)1.25 1
B)5 4
C)1 4
D)5 1
113.通用过程可以通过 A 执行“工具”菜单中的命令来建立。
A)添加过
上一篇:毕业实习任务书