發表文章

目前顯示的是 12月, 2020的文章

曾茂德17+18週期末考

劉任昌2021年1月期末考 現值 利率 期數 金流 終值

第十六週word+EXCEL嵌入

  現值 4265556 利率 0.001 期數 240 金流 20000

第十五週

利率y(rate) 期數n(nper) 金流m(pmt) 終值f(fv) 參考 劉任昌金融市場講義 劉任昌學習HTML+CSS+JavaScript程式碼

第十四週

Dim n As Integer Dim spec As String Const period As Integer = 4 Const maxerror As Double = 0.0000001 Dim payment(period) As Double '廣域變數 4 維度的陣列 Private Sub CommandButton1_Click() Dim a, b, c, f, gap As Double Dim loopNumber As Integer n = n + 1 '第幾次計算+1 a = 0 '報酬率0 b = 1 '報酬率1 gap = 10 loopNumber = 10 payment(0) = TextBox1.Value payment(1) = TextBox2.Value payment(2) = TextBox3.Value payment(3) = TextBox4.Value f = npv(a) If f = 0 Then Label9.Caption = 0 ElseIf f mexerror And Abs(f) > maxerror And loopNumber maxerror And gap > maxerror Then If f > 0 Then a = c Else b = c gap = b - a End If Else Label9.Caption = c End If Loop End If Label10.Caption = f Label11.Caption = loopNumber ' spec = "躉繳$" & payment(0) & ", 第1期$" & payment(1) & ",第2期$" & payment(2) & ...