运行下列程序:
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题:
( 25 )要求当鼠标在图片框 P1 中移动时,立即在图片框中显示鼠标的位置坐标。下面能正确实现上述功能的事件过程是
A )
Private Sub P1_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
Print X,Y
End Sub
B )
Private Sub P1_MouseDown ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
Picture.Print X,Y
End Sub
C )
Private Sub P1_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
P1.Print X,Y
E n d S u b
D )
Private Sub Form_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
P1.Print X,Y
End Sub
第2题:
(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
第3题:
执行下列程序后,鼠标单击窗体,输出结果为 。
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.ClickDownUp
C.DownClickUp
D.UpDownClick
第4题:
下列程序的运行结果是( )。 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
第5题:
下列程序的功能是:当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
第6题:
(27)有下列函数过程( )。 Function fun1(By Val x As Integer,By Valy As Integer) As Integer Do While y<>0 reminder=x Mody x=y y=reminnder Loop Fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,b) Print x End Sub A.0 B.25 C.50 D.100
第7题:
有如下函数过程: 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
第8题:
设有如下程序:
Private Sub Form_Click()
Dim i As Integer,x As String,Y As String
x=”ABCDEFG”
For i=4 To 1 Step-1
y=Mid(x,i,i)+y
Next i
Print y
End Sub
程序运行后,单击窗体,输出结果为
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第9题:
下列程序的功能是:当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
第10题:
下列程序的功能是求方程: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