窗体中有命令按钮Command1,事件过程如下:Public Function f(x As Integer)As IntegerDim y As Integerx=20y=2f=x*YEnd FunctionPrivate Sub Command 1_Click()Dim y As Integerstatic x As Integerx=10y=5y=f(x)Debug.Print x;yEnd Sub运行程序,单击命令按钮,则立即窗口中显示的内容是( )。A.10 5B.10 40C.20 5D.20 40
窗体中有命令按钮Command1,事件过程如下:
Public Function f(x As Integer)As Integer
Dim y As Integer
x=20
y=2
f=x*Y
End Function
Private Sub Command 1_Click()
Dim y As Integer
static x As Integer
x=10
y=5
y=f(x)
Debug.Print x;y
End Sub
运行程序,单击命令按钮,则立即窗口中显示的内容是( )。
A.10 5
B.10 40
C.20 5
D.20 40
相关考题:
设有如下通用过程: 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 5B.20 5C.20 40D.10 40
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:Private Sub Command1_Click()Dim a(10)As IntegerDim x As IntegerFor i=1 To 10a(i)=iNext ix=1MsgBoxa(f(x)+x)End SubFunction f(y As Integer)y=y+2f=yEnd Function程序运行后,单击命令按钮,消息框的输出结果为______。
在窗体中添加—个名称为Command1的命令按钮,然后编写如下事件代码: Private Sub Command1_Click() s="ABBACDDCBA" For I=6 To 2 Step -2 x=Mid(s,I,I) y=Left(s,I) z=Right(s,I) z=x y z Next I MSgBox z End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果是______。A.AABAABB.ABBABAC.BABBAD.BBABBA
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x = 20 y = 2 f = x * y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Static x As Integer x = 10 y = 5 y = f(x) Print x;y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是A.10 5B.20 5C.20 40D.10 40
设有如下通用过程: 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 5B.20 5C.20 40D.10 40
设有如下通用过程: 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 5B.20 5C.20 40D.10 40
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click()x = -5If Sgn(x) Then y = Sgn(x ^ 2)Else y = Sgn(x)End IfPrint yEnd Sub程序运行后,单击命令按钮,窗体上显示的是( )。A.-5B.25C.1D.-1
11、下面哪些定义是类型正确的?A.f :: (Integer, Integer) - Float f (x,y) = x / yB.f :: (Integer, Integer) - Float f (x,y) = (fromInteger x) / (fromInteger y)C.f :: (Integer, Integer) - Float f (x,y) = 3*x + yD.f :: (Integer, Integer) - Integer f (x, y) = 3*x + y