运行下列程序:
Private Sub form_Click( )
x = 8: y = 2
Call fun1((x), y)
Print x, y
End Sub
Private Sub fun1(x, y)
s = x
x = s / y
y = s Mod y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.4 2
B.8 2
C.8 0
D.2 4
第1题:
(28)下列程序的运行结果是。 Private Sub Command1_Click() a=1.5 b=1.5 Call fun(a,b) Print a,b Private Sub fun(x,y) x=y*x y=y+x End SubA.2.25 3.75 B.1.5 2.25 C.1.5 0.75 D.0.75 1.5
第2题:
下列程序的功能是:当x<50时,y=0.8*Π;当50≤x≤100时,y=0.7*Π;当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
第3题:
下列程序的运行结果是( )。 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.25 3.75
B.1.5 2.25
C.1.5 0.75
D.0.75 1.5
第4题:
下列程序的运行结果是( )。 Private Sub Commandl_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.25 3.75
B.1.5 2.25
C.1.5 0.75
D.0.75 1.5
第5题:
执行下列程序后,鼠标单击窗体,输出结果为
Private Sub Form_Click()
Print "Click";
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
Print "Donw"
End Sub
Private Sub Form_MouseUp(ButtonAs Integer,Shift As Integer,X As Single,Y As Single)
Print "Up"
End Sub
A.DownUpClick
B.ClickDownUp
C.DownClickUp
D.UpDownCliek
第6题:
下列程序的功能是:当x<50时,y=0.8×x;当50≤x≤100时,y=0.7×x;当x>100时,没有意义。请填空。
Private Sub Command1_Click()
Dim x AS Single
x=InputBox("请输入x的值!")
________
Case Is<50
y=0.8*x
Case 50 To 100
y=0.7*K
__________
Print"输入的数据出界!"
End Select
Print x,y
End Sub
第7题:
下面程序: 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.显示错误信息
第8题:
运行下列程序:
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
第9题:
运行下列程序:
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
第10题:
运行下列程序:
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
第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题:
有如下函数过程: Function fun1(ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a AS Integer Dim b As Integer a=100 b=25 x=fun1(a,B) Print x End Sub
A.0
B.25
C.50
D.100
第14题:
下列程序的功能是:当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
第15题:
下列程序的功能是求方程:x2+y2=1000的所有整数解。请在空白处填入适当的语句,使程序完成指定的功能。
Private Sub Command 1_Click()
Dim x as intege,y as integer
For x=-34 To 34
For y=-34 To 34
If______Then
Debug.print x,Y
End If
Next y
Next x
End Sub
第16题:
单击一次窗体之后,下列程序代码的执行结果为______。 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
第17题:
以下程序运行后的输出结果是 ______。 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
第18题:
下面程序: 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.显示错误信息
第19题:
执行下列程序后,鼠标单击窗体,输出结果为 Private Sub Form_Click() Print"Click": End Sub Private Sub Form_MouseDown(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Donw" End Sub Private Sub Form_MouseUp(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Up" End Sub
A.DownUpClick
B.CfickDownUp
C.DownClickUp
D.UpDownClick
第20题:
运行下列程序:
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.显示出错信息
第21题:
运行下列程序:
Private Sub Form_Click( )
Dim a As Integer
a = 1
For i = 1 To 5
Call fun1(a)
Next i
Print a
End Sub
Private Sub fun1(x)
y = 2
Do
x = x + y
Loop Until x > 10
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.5
B.1 2 3 4 5
C.19
D.7
第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题:
有如下函数过程: Function fun1 (ByVal x As Integer, ByVal y As Integer) As Integer Do While y <> 0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调节器用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=fun1(a,b)Print x End Sub
A.0
B.25
C.5O
D.100