在窗体上画一个命令按钮,名称为Command1。 Private Sub Command1 Click() Dim x As Integer,y As Integer x=10:y:0 Do x=x+2:y=y+x Print "x=", x; "y=",y If y>20 Then Exit Do Loop Until x=18 End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是 ______。
A.x=12y=12 x = 14 y = 16 x=16 y=18
B.x=12 y=12 x= 16 y =28 x= 18 y=24
C.x=12 y=12 x= 14 y=44
D.x= 12 y=12 x= 14 y=26
第1题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub subl(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 subl(1, 2,a) Print a End Sub 程序运行后,单击命令按钮,则窗体下显示的内容是______。
A.8
B.2
C.5
D.11
第2题:
在窗体上画1个命令按钮,名称为Command1,然后编写如下程序: Dim Flag As Boolean Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(“请输入:”) If Flag Then Print f(intNum) End If End Sub Function f(X as Integer)As Integer If X<10 Then Y=X Else Y=X+10 End If f=Y End Function Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X as Single,Y As Single) Flag=True End Sub 运行程序,首先单击窗体,然后单击命令按钮,在输入对话框中输入5,则程序的输出结果为______。
A.0
B.5
C.15
D.无任何输出
第3题:
( 11 )在窗体中添加一个名称为 Command1 的命令按钮,然后编写如下事件代码:
Private Sub Command1_Click( )
Dim x As Integer, y As Integer
x=12 : y=32
Call p(x, y)
MsgBox x*y
End Sub
Public Sub p (n As Integer, By Val m As Integer)
n=n Mod 10
m=m Mod 10
End Sub
窗体打开运行后,单击命令按钮,则消息框的输出结果为 ___________ 。
第4题:
在窗体上画一个命令按钮,其名称为Command1,然后编写如卞程序:
Private Sub Command1-Click()
Dim a(10) As Integer
Dim x As Integer
For i=1 To 10
a(i)=i
Next i
x=1
MsgBox a(f(x)+x)
End Sub
Function f(y As Integer)
y=y+2
f=y
End Function
程序运行后,单击命令按钮,消息框的输出结果为______。
第5题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim x As Integer Static y As Integer Cls x=x+5 y=y+3 Print x,y End Sub 程序运行时,两次单击命令按钮Command1后,窗体显示的结果是( )。
A.10 6
B.5 6
C.5 3
D.10 3
第6题:
在窗体上画1个命令按钮,其名称为Command1,然后编写如下程序: Private Sub Command1 Click() Dim a(10) As Integer Dim x As Integer For i=1 To 10 a(i)=8+i Next x=2 Print a(f(x)+x) End Sub Function f(x As Integer) x=x+3 f=x End Function 程序运行后,单击命令按钮,输出结果为______。
A.12
B.15
C.17
D.18
第7题:
在窗体中添加一个命令按钮(名为Command1)和一个文本框(名为text1),编写如下事件过程:
Private Sub Command1_Click()
Dim x As Integer,y As Integer,z As Integer
Call f(x,y,z)
End Sub
Sub f(a As Integer,b As Integer,c As Integer)
c=b*a
End Sub
打开窗体运行后,单击命令按钮,文本框中显示的内容是( )。
第8题:
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x=20 y=2 f=x*y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x; y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是______。
A.10 5
B.20 5
C.20 40
D.10 40
第9题:
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:
Private Sub Command1_Click()
Dim a(10)As Integer
Dim x As Integer
For i=1 To 10
a(i)=i
Next i
x=1
MsgBoxa(f(x)+x)
End Sub
Function f(y As Integer)
y=y+2
f=y
End Function
程序运行后,单击命令按钮,消息框的输出结果为______。
第10题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub Commandl_Click( )
Static X As Integer
Static Y As Integer
Cls
Y=1
Y=Y+5
X=5+X
Print X, Y
End Sub
程序运行时,3次单击命令按钮Command1后,窗体上显示的结果为【 】。