以下程序:
PublicSubSwap1(xAsInteger,ByValyAsInteger)
DimtAsInteger
t=x:x=y:y=t
EndSub
PublicSubSwap2(xAsInteger,yAsInteger)
DimtAsInteger
t=x:x=y:y=t
EndSub
PrivateSubCommand1_Click()
DimaAsInteger,bAsInteger
a=10:b=20
Swap1a,b
Print"A1=";a,"B1=";b
a=10:b=20
Swap2a,b
Print"A2=";a,"B2=";b
EndSub
当单击命令按钮后,窗体上输出的结果是( )
A.A1=20B1=10A2=10B2=20
B.A1=10B1=20A2=20B2=10
C.A1=10B1=20A2=10B2=10
D.A1=20B1=20A2=20B2=10
第1题:
要想在过程Proc调用后返回形参x和y的变化结果,下列定义语句中正确的是______。
A.Sub Proc(x as Integer, y as Integer)
B.Sub Proc(By Val x as Integer, y as Integer)
C.Sub Proc(x as Integer, By Val y as Integer)
D.Sub Proc(By Val x as Integer, By Val y as Integer)
第2题:
要想在过程Proc调用后返回形参x和Y的变化结果,下列定义语句中正确的是( )。【考点5过程调用与参数传递】
A.Sub Proc(x as Integer,Y as Integer)
B.Sub Proc(ByVal x as Integer,Y as Integer)
C.Sub Proc(x as Integer,ByVal Y as Integer)
D.Sub Proc(ByVal x as Integer,ByVal Y as Integer)
第3题:
单击按钮时,以下程序运行后的输出结果是 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
第4题:
单击一次窗体之后,下列程序代码的执行结果为______。 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
第5题:
以下程序运行后,单击按钮输出结果是 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