在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下: Private Function fun(ByVal m As Integer) If m Mod 2 = 0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Cliek() Dim i As Integer, s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出( )。A.6B.7C.8D.9

在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下: Private Function fun(ByVal m As Integer) If m Mod 2 = 0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Cliek() Dim i As Integer, s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出( )。

A.6

B.7

C.8

D.9


相关考题:

在窗体上画一个名称为Commandl的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(By Val m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Commandl_Click() Dim i As Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是______。A. 6B.7C.8D.9

(31)设有如下通用过程:Public Function Fun(xStr As String)As StringDim tStr As String, strL As IntegertStr=""strL=Len(xStr)i=1i=i+1LoopFun=tStrEnd Function在窗体上画一个名称为 Command1 的命令按钮。然后编写如下的事件过程:Private Sub Command1_Click( )Dim S1 As StringS1="abcdef"Print UCase(Fun(S1))End Sub程序运行后,单击命令按钮,输出结果是( )。A)ABCDEFB)abcdefC)AFBECDD)DEFABC

在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程:Private Function fun(ByVal m As Integer)If m Mod 2 = 0 Thenfun = 2Elsefun = 1End IfEnd FunctionPrivate Sub Command1_Click()Dim i As Integer, s As Integers = 0For i = 1 To 5s = s + fun(i)NextPrint sEnd Sub程序运行后,单击命令按钮,在窗体上显示的是( )。A.6B.7C.8D.9

在窗体上有一个命令按钮Commandl,通用过程fun和命令按钮的事件过程如下: Private Function fun(By m As Integer) If m Mod 2=0 Then fun=2 Else Fun=1 Else If End Funcion Private Sub Commandl_Click() Dim i Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出A.6 B.7 C.8 D.9

窗体上有一个名称为Text1的文本框和一个名称为Command1、标题为“计算”的命令按钮,如图所示。函数fun及命令按钮的单击事件过程如下,请填空。Private Sub Command1_Click()Dim x As Integerx=Val(InputBox(“输入数据”))Text1=Str(fun(x)+fun(x)+fun(x))End SubPrivate Function fun(ByRef n As Integer)Ifn Mod 3=0 Thenn=n+nElsen=n*nEnd If________=nEnd Function当单击命令按钮,在输入对话框中输入2时,文本框中显示的是_______。

在窗体上绘制一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click() Dim i As Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是A.6B.7C.8D.9

在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程; Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_C1ick() Dim i As Integer, s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是______。A.6B.7C.8D.9

在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下:Private Function fun(ByVal m As Integer)Ifm Mod2=0 Thenfun=2Elsefun=1End IfEnd FunctionPrivate Sub Command1_Click()Dim i As Integer,s As Integers=0For i=1 To 5s=s+fun(i)NextPrintsEnd Sub程序运行后,单击命令按钮,则窗体上输出( )。A.6B.7C.8D.9

在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click( ) Dim i As Integer,s As Integer S=0 For i=1 To 5 s=s+fun(i) Next Print 3 End Sub 程序运行后,单击命令按钮,在窗体上显示的是A.6B.7C.8D.9