运行下列程序:
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
第1题:
单击命令按钮时,下列程序代码的执行结果为( )。 Private Function FirProc(x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Funcfion Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Funcfion Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2 b=3 c=4 Printf SecProc(c,b,a) End Sub
A.21
B.19
C.17
D.34
第2题:
单击命令按钮时,下列程序的执行结果为 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
第3题:
单击命令按钮时,下列程序的执行结果是 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
第4题:
单击按钮时,以下程序运行后的输出结果是 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
第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题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click () Dim a As Integer, b As Integer, c As Integer a = 1: b = 2: c = 3 Print fun2 (c, b,A)End Sub Private Function funl (x As Integer, y As Integer, z As Integer) fun1 = 2 * x + y + 3 * z End Function Private Function fun2(x As Integer, y As Integer, z As Integer) fun2 = fun1(z, x, y)+ x End Function程序运行后,单击命令按钮,则窗体上显示的内容是
A.7
B.14
C.17
D.30
第7题:
单击命令按钮执行下列程序,其输出结果是( )。 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
第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 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.显示错误信息
第10题:
运行下列程序:
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
第11题:
下面程序:
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.显示错误信息
第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 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.Str(z)
D.显示错误信息
第14题:
设有如下程序: Private Sub Form. Click( ) Dim i As Integer,x As String,y As String x="ABCDEFG" For i=4 To 1Step-1 y=Mid(X,i,i)+y Next i Print y End Sub 程序运行后,单击窗体,输出结果为( )。
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第15题:
下面程序:
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.Str(z)
D.显示错误信息
第16题:
有如下程序: 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 * ##
第17题:
单击一次窗体之后,下列程序代码的执行结果为______。 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
第18题:
有如下函数: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
第19题:
当发生Form_Click事件时,下列程序的输出结果是( )。 Private m As Integer,n As Integer Private Sub Form_Click() Dim k As Integer,p As Integer k=6:p=60 Call sub1(k,p) Print m,n,m,k,p Call sub1(k,p) Print m,n,k,p End Sub Private Sub Form_Load() m=7 n=70 End Sub Public Sub sub1(x As Integer,ByVal y As Integer) Dim m As Integer n=n+5 m=n+x+y x=x+y y=x+y End Sub
A.7 75 66 60 7 80 126 60
B.7 75 66 60 7 75 126 60
C.7 75 66 60 7 80 66 60
D.7 75 66 60 7 75 66 60
第20题:
阅读下面的程序; 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
第21题:
在窗体上画一个名称为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
第22题:
设有如下程序:
Private Sub Form. Click( )
Dim i As Integer,x As String,y As String
x="ABCDEFG"
For i=4 To 1Step-1
y=Mid(X,i,i)+y
Next i
Print y
End Sub
程序运行后,单击窗体,输出结果为( )。
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第23题:
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( )。 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.程序不能运行