填空题
本程序的功能是按下列公式编写求积分余弦函数值,当通项的绝对值小于10 时停止计算,请完善本程序。(提示:函数fact是用递归求阶乘。)
f(x)=lnx+ , x>0
Option Explicit
Private Sub Command1_Click1
Dim x As Single,y As Single
Dim k As Integer,tx As Single
x=Val(Text1.Text)
y=Log(x)
Do
k=k+1
tx= 2(16) 3
y=y+tx
Loop while 4(17) 5
Text2.Text=Format(y,"0.#######")
End Sub
Private Function fact(ByVal n As Integer)As Long
If n<=1 Then
fact=1
Else
fact= 6(18) 7
EndIf
End Function