更多"如下事件过程:
Function Feed(x)
If"的相关试题:
[单项选择]如下事件过程:
Function Feed(x)
If x <10 Then
Feed=X
Else
Feed=10+x
End If
End Function
Private Sub Command1_Click( )
x=Val(Input Box(" ",0))
pay=Feed(x)
Print pay
End Sub
运行时在输入框内输入变量x的值为15,输出结果为( )。
A. 1234
B. foo~ ~bar
C. virtual
D. 34var
[单项选择]如下事件过程: Function Feed(x) If x <10 Then Feed=X Else Feed=10+x End If End Function Private Sub Command1_Click( ) x=Val(Input Box(" ",0)) pay=Feed(x) Print pay End Sub 运行时在输入框内输入变量x的值为15,输出结果为
A. 0
B. 15
C. 25
D. 30
[单项选择]有如下事件过程:
Function UNC (ByVal x As Integer,ByVal y As Integer) As Integer
Do While y<>0
sic=x/y
x=y
y=sic
Loop
UNC=x
End Function
以下是该函数的调用过程,该程序的运行结果是( )。
PriVate Sub COmmand1_Click( )
Dim a As Integer
Dim b As Integer
a=12
b=2
x=UNC (a,b)
Print x
End Sub
A. 0
B. 6
C. 2
D. 80
[单项选择]有如下事件过程: Function UNC (ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 sic=x/y x=y y=sic Loop UNC=x End Function 以下是该函数的调用过程,该程序的运行结果是 PriVate Sub COmmand1_Click( ) Dim a As Integer Dim b As Integer a=12 b=2 x=UNC (a,b) Print x End Sub
A. 0
B. 6
C. 2
D. 80
[单项选择]编写如下事件过程:
Private sub sub1 (ByVal x1 As String, y1 As String)
Dim xt As String
Dim i As Integer
i = Len(x1)
Do While i>= 1
xt = xt + Mid(x1, i, 1)
i=i-1
Loop
y1 = xt
End Sub
Private Sub Form Click( )
Dim s1 As String, s2 As String
s1= "teacher"
sub1 s1, s2
Print s2
End Sub
程序运行后,单击窗体,则窗体上显示的内容是
A. rehcaet
B. tahreee
C. themee
D. eerthea
[单项选择]假定有如下事件过程:
Private Sub Form Click( )
Dim x As Integer, n As Integer
x=1
n=0
Do While x<28
x=x*3
n=n+1
Loop
Print x, n
End Sub
程序运行后,单击窗体,输出结果是______。
A. 81 4
B. 56 3
C. 28 1
D. 243 5
[单项选择]假定有如下事件过程:
Privte Sub Form_Click( )
Dim x As Integer,n As Integer
x=1
n=0
Do While x<28
x=x*3
n=n+1
Loop
Print x,n
End Sub
程序运行后,单击窗体,输出结果是
A. 81 4
B. 56 3
C. 28 1
D. 243 5
[填空题]在窗体上有一个命令按钮,然后编如下事件过程:
Function SR( x As Double)As Double
Select Case Sgn(x)
Case 1
SR=Sqr(x)
Exit Function
Case 0
SR=0
Case-1
SR=-1
End Select
End Function
Private Sub Command1 _ Click( )
Dim Msg,SRN
Dim N AS Double
N=InputBox("请输入要计算平方根的数")
Msg=N&"的平方根"
Select Case SR(N)
Case 0
Msg=Msg &"是0"
Case-1
Msg=Msg&"是一个虚数"
Case ElSe
Msg=Msg &"是"& SR(N)
End Select
MsgBox Msg
End Sub
程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是【 】。
[填空题]在窗体上有一个命令按钮,然后编如下事件过程:
Function SR( x As Double)As Double
Select Case Sgn(x)
Case 1
SR=Sqr(x)
Exit Function
Case 0
SR=0
Case-1
SR=-1
End Select
End Function
Private Sub Command1 _ Click( )
Dim Msg,SRN
Dim N AS Double
N=InputBox("请输入要计算平方根的数")
Msg=N&"的平方根"
Select Case SR(N)
Case 0
Msg=Msg &"是0"
Case-1
Msg=Msg&"是一个虚数"
Case ElSe
Msg=Msg &"是"& SR(N)
End Select
MsgBox Msg
End Sub
程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是 【15】 。
[单项选择]编写如下事件过程和函数过程: Private Sub Command1_Click( ) Dim num(1 To 6)As Single num(1)=103:num(2)=190:num(3)=0 num(4)=32:num(5)=-56:num(6)=100 Print Print p2(6,num( )) End Sub Private Function p2(By Val n As Integer, number( ) As Single) As Integer p2=number(1) For j=2 To n If number(j)<p2 Then p2=number(j) Next j End Function 程序运行后,在窗体上输出( )。
A. -56
B. 0
C. 103
D. 190
[单项选择]编写如下事件过程和函数过程:
Private Sub Command1_Click( )
Dim num(1 To 6) As Single
num(1)=103: num(2)=190: num(3)=0
hum(4)=32:num(5)=-56: num(6)=100
Print
Print p2(6,num( ))
End Sub
Private Function p2(ByVal n As Integer, number( ) As Single) As Integer
p2=number(1)
For j=2 To n
If number(j)<p2 Then p2=number(j)
Next j
End Function
程序运行后,在窗体上输出( )。
A. -56
B. 0
C. 103
D. 190