更多"在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件"的相关试题:
[单项选择]在窗体上有一个命令按钮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_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. 6
B. 7
C. 8
D. 9
[单项选择]在窗体上有一个命令按钮Command1,编写如下程序:
Private Sub Command1_Click( )
Print pp1(3, 7)
End Sub
Public Function pp1(x As Single, n As Integer) As Single
If n = 0 Then
pp1 = 1
Else
If n Mod 2=1 Then
pp1=x*x+n
Else
pp1=x*x-n
End If
End If
End Function
程序运行后,单击该命令按钮,屏幕上显示的是( )。
A. 2
B. 1
C. 0
D. 16
[单项选择]在窗体上有一个命令按钮Command1,编写下列程序:
Private Sub Command1_Click( )
Print ppl(3,7)
End Sub
Public Function ppl(X As Single,n As Integer)As Single
If n=0Then
ppl=1
Else
If n M0d 2=1 Then
ppl=x*x+n
EIse
ppl=x*x-n
End If
End If
End Function
程序运行后,单击该命令按钮,屏幕上显示的是( )
A. 2
B. 1
C. 0
D. 16
[单项选择]在窗体上有一个命令按钮Command1,编写事件代码如下:
Private Sub Command1_Click( )
Dim y As Integer
y=0
Do
y=InputBox("y=")
If(y Mod 10)+Int(y/10)=10 Then Debug.Print y;
Loop Until y=0
End Sub
打开窗体运行后,单击命令按钮,依次输入10、37、50、55、64、20、28、19、-19、0,立即窗口上输出的结果是
A. 37 55 64 28 19 19
B. 10 50 20
C. 10 50 20 0
D. 37 55 64 28 19