运行下列程序:
Dim x, y
Private Sub Form_Click( )
x = 1: y = 1: z = 1
fun1 (1)
Print x; y; z
End Sub
Private Sub fun1(a)
x = a + x: y = a + x: z = a + y
End Sub
单击窗体后,则输出结果是( )。
A.1 1 1
B.2 3 1
C.2 3 4
D.2 2 1
第1题:
单击按钮时,以下程序运行后的输出结果是 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
第2题:
下列程序运行后在立即窗口输出结果是( )。 Private Sub Form_Click() x="a":y="b" z=1:u=2 Debug. Print x; y, z; u Debug. Print z; x, y; u End Sub
A.a b 1 2 1 ab 2
B.a b 1 2 1 a b 2
C.a b 1 2 1 a b 2
D.a b 1 2 1 a b 2
第3题:
单击一次窗体之后,下列程序代码的执行结果为______。 Private Sub Command1_ Click() Dim a As Integer, b As Integer, c As Integer a = 1: b = 2: c = 4 Print Value(a, b,C)End Sub Function Num(x As Integer, y As Integer, z As Integer) Num = x * x + y * y + z * z End Function Function Value(x As Integer, y As Integer, z As Integer) Value = Num(x, y, z) + 2 * x End Function
A.21
B.23
C.19
D.35
第4题:
以下程序运行后的输出结果是 ______。 Sub add(x,y) x=x+y Print "x=";x;",y=";y End Sub Private Sub Command1_Click() x=1 y=1 Call add((x),(y)) Print"x="; x;",y=";y End Sub
A.x=1,y=1 x=2,y=2
B.x=2,y=1 x=1,y=1
C.x=1,y=1 x=1,y=1
D.x=2,y=1 x=2,y=1
第5题:
下面程序: 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.显示错误信息
第6题:
阅读下面的程序; 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
第7题:
在窗体上画一个名称为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
第8题:
运行下列程序:
Private Sub Form_Click( )
a$ = 2
b$ = 1
Call abcd(a, b, c$, d$)
Print c; d
End Sub
Private Sub abcd(x$, y$, z$, s$)
z = x + y
s = x - y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.3 1
B.1 3
C.211
D.显示出错信息
第9题:
运行下列程序:
Dim b
Private Sub Form_Click( )
a = 1: b = 1
Call fun1(a)
Print "X = "; a; ",Y = "; b
End Sub
Private Sub fun1(a)
b = 2 * a
a = 3 * b
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.X = 1,Y = 1
B.X = 2,Y = 6
C.X = 6,Y = 2
D.X = 6,Y = 1
第10题:
下面程序:
Private Sub Form_Click()
Dim x,y,z As Integer
x=5
y=7
z=0
Call P1(x,y,z)
Print Str(z)
End Sub
Sub P1(By Val a As Integer, By Val b As Integer, c As Integer)
c=a+b
End Sub
运行后的输出结果为______。
A.0
B.12
C.Str(2)
D.显示错误信息
第11题:
程序段如下,当发生Form_Click事件时,窗体上输出的结果是( )。 Option Explicit Private x As Integer Public y As Integer Sub Test() Dim y as integer x=2:y=2 Print"x1=";x;"y1=";y End Sub Private Sub Form_Click() x=1:y=1 Test Print "X2=";x;"y2=";y End Sub
A.x1=2 y1=2 x2=2 y2=1
B.x1=2 y1=2 x2=2 y2=2
C.x1=2 y1=1 x2=2 y2=2
D.x1=2 y1=1 x2=2 y2=1
第12题:
以下是某个窗体的模块代码,请分析单击窗体后程序运行至"*"号位置时变量X、Y和Z的值分别是【 】。
DIM X AS INTEGER
DIM Y AS INTEGER
PRIVATE SUB FORM_CLICK()
DIM X AS INTEGER
X=1
Y=1
CALL AA(Y+1)
Z=BB(X)
'* * * * * * *
MSGBOX "X="&X&"/Y="&Y&"/Z="&Z
END SUB
PRIVATE SUB AA(BYVAL Z AS INTEGER)
Y=Z+X
Z=X+Y
END SUB
PRIVATE FUNCTION BB(BYREF Y AS INTEGER
Y=Y+1
BB=X+Y
END FUNCTION
第13题:
有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m &"*”:n=n&"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * #
B.1 1 * #
C.1 1 * # 1 1 * # 1 2 * #
D.1 1 * # 1 1 * ## 1 2 * ##
第14题:
单击一次窗体之后,下列程序代码的执行结果为______。 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
第15题:
有如下事件过程: Private Sub Commaild1_Click( ) Dim i As Integer For i =1 To 2 DC Next i End Sub Sub DC( ) Dim x As Integer,m As String Static y,n x=x + 1 y=y + 1 m=m&"*":n=n &"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * # 1 1 * #
B.1 1 * # 1 2 * #
C.1 1 * # 1 1 * ##
D.1 1 * # 1 2 * ##
第16题:
有如下函数: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
第17题:
有下列程序: 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
第18题:
下面程序: Private Sub Form_Click() Dim x,y,z As Integer x=5 y=7 z=0 Call P1(x,y,z) Print Str(z) End Sub Sub P1(ByVal a As Integer,ByVal b As Integer,c As Integer) c=a+b End Sub 运行后的输出结果为 ______。
A.0
B.12
C.Sb(z)
D.显示错误信息
第19题:
运行下列程序:
Private Sub Form_Click( )
Dim x As Integer, y As String, z As String
y = "12345"
For x = 1 To Len(y)
z = Mid(Left(y, x), 1)
Next x
Print z
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.1
B.11111
C.55555
D.12345
第20题:
运行下列程序:
Private Sub Form_Click( )
Dim y As Integer, x As Integer
Do Until x > 20
x = x + 10
y = y + x
If x > 20 Then Exit Do
Loop
Print x, y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.10 20
B.30 60
C.10 30
D.20 60
第21题:
以下程序运行后,单击按钮输出结果是 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
第22题:
单击按钮时,以下列程序运行后的输出结果是 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
第23题:
单击按钮时,以下程序运行后的输出结果是 Private Sub Commandl_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