更多"阅读下面的程序; Function Func(x As Intege"的相关试题:
[单项选择]阅读下列程序:
Function func(n As Integer)As Integer
Sum = 0
For i = 1 To n
Sum = Sum + (i + 1)* i
Next i
func = Sum
End Function.
Private Sub Command1_Click ( )
Dim a As Integer
a= 5
s = func (
A. 60
B. 70
C. 15
[填空题]阅读下面程序
Private Function a (load As Integer)As Single
If loud<20 then
money=lnad/2
else
money=20+load
end if
a=money
End Function
Private Sub Form_Click( )
Dim load As Integer,fee As Single
Load=InputBox("请输入一个数:")
Fee=a(load)
Print fee
End Sub
运行后的输出结果是 【12】 。
[填空题]阅读下面程序。
Private Function a(load As Integer) As Single
If load < 20 then
money = load / 2
else
money = 20 + load
end if
a = money
End Function
Private Sub Form_Click( )
Dim load As Integer, fee AS Single
Load = InputBox ("请输入一个数: ")
Fee = a(load)
Print fee
End Sub
输入20,运行后的输出结果是 【13】 。
[填空题]阅读下面程序。
Private Function a(load As Integer) As Single
If load < 20 then
money = load / 2
else
money = 20 + load
end if
a = money
End Function
Private Sub Form_Click( )
Dim load As Integer, fee AS Single
Load = InputBox ("请输入一个数: ")
Fee = a(load)
Print fee
End Sub
输入20,运行后的输出结果是 【13】 。
[单项选择]假定有下面的过程:
Function Func(a As Integer,b As Integer)As Integer
Static m As Integer,i As Integer
m=0
i=2
i=i+m+1
m=i+a+b
Func=m
End Function
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command 1_Click( )
Dim k As Integer,m As Integer
Dim p As Integer
k=4
m=1
p=Func(k,m)
Print p;
p=Func(k,m)
Print p
End Sub
程序运行后,单击命令按钮,输出结果为( )。
A. 8 17
B. 8 16
C. 8 20
D. 8 8
[单项选择]以下用户自定义函数 Function Func(a As Integer,b As Integer)As Integer Static m As Integer.i As Integer m=0:i=2 i=i+m+i m=i+a-i-b Func=m End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim k As Integer,m As Integer,p As Integer k=4:m=1 P=Func(k,m) Print P End Sub 程序运行后,单击命令按钮,输出结果为
A. 8
B. 9
C. 10
D. 11
[单项选择]有下列函数过程:
Function Func2(a As Integer,b As Integer)As Integer
Staticm As Integer,i As Integer
m=0
i=2
a=i+m+1
b=i+a+b
Func2=m
End Function
在窗体上画一个命令按钮,然后编写下列事件过程:
Private Sub Command1_Click( )
Dim p As Integer,k As Inmger,m As Integer
k=4
m=1
p=Func2(k,m)
Prim k;m
p=Func2(k,m)
Print k;m
End Sub
程序运行后,单击命令按钮,输出结果是( )。
A. 3 6<CR>3 6
B. 3 6<CR>3 11
C. 3 11<CR>3 6
D. 3 11<CR>3 11
[单项选择]阅读程序:
Function fac(ByVal n As Integer)As Integer
Dim temp As Integer
temp=1
For i%=1 To n
temp=temp*i%
Next i%
fac=temp
End Function
Private Sub Form_Click( )
Dim nsum As Integer
nsum=1
For i%=2 To 4
nsum=nsum+fac(i%)
Next i%
Print nsum
End Sub
程序运行后,单击窗体,输出结果是( )。
A. 35
B. 31
C. 33
D. 37
[单项选择]阅读程序:
Function Fun( a As Integer)
Static c
b=0:b=b+2:c=c+2
F=a*b*c
End Function
Private Sub Commandl _ Click( )
Dim a As Integer
a=2
For i = 1 To 2
Print Fun (
A. ;
[单项选择]以下用户自定义函数
Function Func(a As Integer, b As Integer) As Integer
Static m As Integer, i As Integer
m=0:i=2
i=i+m+i
m=i+a+b
Func=m
End Function
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim k As Integer,m As Integer,p As Integer
k=4:m=1
P=Func(k,m)
Print p
End Sub
程序运行后,单击命令按钮,输出结果为
A. 8
B. 9
C. 10
D. 11
[单项选择]以下用户自定义函数
Function Func(a As Integer,b As Integer) As Integer
Static m As Integer,i As Integer
m=0:i=2
i=i+m+i
m=i+a+b
Func=m
End Function
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim k As Integer,m As Integer,p As Integer
k=4:m=1
P=Func(k,m)
Print p
End Sub
程序运行后,单击命令按钮,输出结果为
A. 8
B. 9
C. 10
D. 11