给出下面程序: Private Sub Command1_Click() Dim x,y,z X=False For Each y In 2 If y.Text="Hello" Then x=True Exit For End If Next y End Sub 下面描述正确的是
A.退出For Each…Next循环的条件是x=True
B.退出For Each…Next循环的条件是x=False
C.程序检查y对象的Text属性,等于“”时退出For Each…Next循环
D.程序逐一查找在z中的对象,不确切并判断其Text属性,文本框中的内容等于“Hello”时退出For Each…Next循环
第1题:
单击命令按钮时,下列程序代码的执行结果为______。 Private Sub Proe1 (n As Integer,ByVa1 m As Integer) n=n Mod 10 m=m\ 10 End Sub Private Sub Command1_Click() Dim x As Integer Dim y As Integer x= 12 y = 34 Call Proe1 (x, y) Print x; y End Sub
A. 12 34
B.2 34
C.2 3
D.12 3
第2题:
单击命令按钮时,下列程序的执行结果是 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+2 End Function Function SecProc (x As Integer,y As hteger,z As Integer) SecProc=FirProc(z,x,y)+x+7 End Function
A.20
B.25
C.37
D.32
第3题:
单击按钮时,以下程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=x+y End Sub Private Sub Command1_Click() Dim x As Integer,y As Integer,Z As Integer x=1:y=2:z=3 Call proc1(x,x,z) Print x;x;z Call proc1(x,y,y) Print x;y;y End Sub
A.6 6 12 `
B.9 5 10 6101051010
C.9 6 12
D.9 10 10 910155410
第4题:
下列程序的功能是:当x<50时,y =0.8 xx;当50≤x≤100时,y=0.7 xx;当x>100时,
Private Sub Command1_Click()
Dim x As Single
x = InputBox("请输入x的值" )
Select Case x
Case Is<50
y=0.8 * x
Case 50 To 100
y=0.7 * x
【 】
Print "输入数据出界!"
End Select
Print x, y
End Sub
第5题:
单击一次窗体之后,下列程序代码的执行结果为______。 Private Sub Command1_ Click() Dim x As Integer, y As Integer, z As Integer x = 1: y = 2: z = 3 Call fun1 (x, y, z) Print x; y; z Call fun2(x, y, z) Print x; y; z End Sub Private Sub fun1(x As Integer, y As Integer, z As Integer) x = 10 * z y=z*z+ x z=x+ y+ z End Sub Private Sub fun2 (ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) x=10*z y=z*z+ x z=x+ y +z End Sub
A.1 2 3 30 39 72
B.1 2 3 1 2 3
C.30 39 72 1 2 3
D.30 39 72 30 39 72
第6题:
单击命令按钮执行下列程序,其输出结果是( )。
Private Sub Command1_Click()
Dim a As Integer,b As Integer,c As Integer
a=3
b=4
c=5
Prim 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
第7题:
有如下函数:Private Function firstfunc(x As Integer, y As Integer) As Integer Dim n As Integer Do While n <= 4 x=x +y n=-+1 Loop firstfunc = x End Function调用该函数的事件过程如下:Private Sub Command1_lick() Dim x As Integer Dim y As Integer Dim n As Integer Dim z As Integer x=1 y=1 For n = 1 To 3 z = firstfunc(x, y) Next n Print z End Sub该事件过程的执行结果是 ______。
A.1
B.3
C.16
D.9
第8题:
下面程序: Private Sub Form_Click() Dim x,y,z As Integer x=5 y=7 z=0 CallPI(x,y,z) Print Str(z) End Sub SubP1(By Val a As Integer, By Val b As Integer, c As Integer) C=a+b End Sub 运行后的输出结果为______。
A.0
B.12
C.Str(z)
D.显示错误信息
第9题:
在窗体中添加一个命令按钮,并编写如下程序: Private Sub Command1_CliCk() X=1∶Y=2∶Z=3 X=Y∶Y=Z∶Z=X Print Z End Sub 程序执行后,输出的结果是______。
A.3
B.0
C.2
D.1
第10题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub sub1(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) z=x * x+ y * y End Sub Private Sub Command1_Click() Dim a As Integer a = 8 Call sub1(1, 2,A)Print a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
A.8
B.2
C.5
D.11
第11题:
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( )。 Private Sub fun(ByVal x As Integer,ByVal y As Integer,Byval z As Integer) z=x^3*y^3 End Sub Private Sub Command1_Click() Dim m As Integer Call fun(2,3,m) Print m End Sub
A.216
B.0
C.35
D.程序不能运行
第12题:
单击按钮时,以下列程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=X+y End Sub Private Sub Command1_Click( ) Dim x As Integer,y As Integer,z As Integer x=1:y=2:z=3 Call proc1(x,x,2) Print x;x;z Call proc1(x,y,y) Print x;y;y End Sub
A.6 6 12 6 6 10
B.9 5 10 5 10 10
C.9 6 12 9 10 15
D.9 5 10 5 4 10
第13题:
单击命令按钮时,下列程序的执行结果为 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
第14题:
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。
A.6, 8
B.10, 10
C.10, 8
D.6, 10
第15题:
有如下过程:
Sub SS(ByVal X,ByRef Y,Z)
X=X + 1
Y=Y + 1
Z=Z + 1
End Sub
执行该过程的事件过程如下:
Private Sub Command1_Click()
A = 1
B = 2
C = 3
Call SS(A,B,C) Print A;B;C
End Sub
则该程序的执行结果是【 】。
第16题:
有如下程序: Private Sub Command1_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1(a,b) End Sub Sub Sub1(x As Single,y As Single) t=X X=t\Y Y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为
A.0 0
B. 1 1
C.2 2
D.1 2
第17题:
阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为
A.0
B.20
C.40
D.无任何输出
第18题:
单击命令按钮时,下列程序的执行结果是
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+2
End Function
Function SecProc(x As Integer, y As Integer, z As Integer)
SecProc=FirProc(z, x, y)+ x+7
End Function
A.20
B.25
C.37
D.32
第19题:
单击命令按钮执行下列程序,其输出结果是( )。 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
第20题:
有下列程序: Private Sub Command1_Click() X$="Nanchang" y$="Beijing" z$="Nanjing" z$=InStr(Left(x$,3)+Right(y$,4),z$) Print z$ End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
A.0
B.1
C.3
D.4
第21题:
阅读下面的程序; Function Func(x As Integer,y As Integer)As Integer Dim n As Integer Do While n < = 4 x=x + y n = n + 1 Loop Func=x End Function Private Sub Command1_Click() Dim x As Integet, y As Integer Dim n As Integer,z As Integer x=1 y=1 For n = 1 To 6 z=Func(x,y) Next n Print z End Sub 程序运行后,单击命令按钮,输出的结果为.
A.16
B.21
C.26
D.31
第22题:
以下程序运行后,单击按钮输出结果是 Private Sub Commandl_Click( ) Dim x As Integer,y As Integer,z As Integer X=4:y=2: Z=3 Call Gopd(x,x,z) Print x;X;Z Call Gopd(x,y,y) Print x;y;y End Sub Private Sub Gopd(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
第23题:
在窗体上画一个名称为Coramandl的命令按钮,然后编写如下程序; Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim a As Boolean SW=False End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox("") If SW Then Print flmc(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为
A.输出0
B.输出2
C.输出45
D.无任何输出