Numericalการหาจำนวนดอกเบีย

  • Uploaded by: Bank
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Numericalการหาจำนวนดอกเบีย as PDF for free.

More details

  • Words: 233
  • Pages: 4
สรุป Numerical Mr. KHIM LAGN Code 50052498

Code for program Dim count As Integer Dim mk As Double Private Sub CommandButton1_Click() Dim a As Double Dim b As Double Dim tol As Double Dim m As Integer Dim result As Double Dim year As Integer m = Val(Range("g4").Value) count = Not count

If count Then For i = 2 To (m + 1) Step 1 a = Val(Range("g1").Value) b = Val(Range("g2").Value) tol = Val(Range("g3").Value) Cells(i, 1) = (i - 1) year = (i - 1) result = regula(a, b, tol, year) Cells(i, 2).Value = result Next i CommandButton1.Caption = "ź" Else Range("A2", "D1501").ClearContents Cells(5, 6) = Clear CommandButton1.Caption = "áÊ´§" End If End Sub Private Function f(x As Double, m As Integer) As Double f = (((288000 / x) * (1 - ((1 + (x / 12)) ^ ((-12) * m)))) - 3000000) End Function Private Function regula(a As Double, b As Double, tol As Double, year As Integer) As Double Dim c As Double If a = 0 Then a = 0.01 End If c = b - ((f(b, year)) * ((b - a) / ((f(b, year)) - (f(a, year))))) Do While Abs(f(c, year)) > tol If (f(a, year) * (f(c, year))) > 0 Then

a=c Else b=c End If c = b - ((f(b, year)) * ((b - a) / ((f(b, year)) - (f(a, year))))) Loop regula = c End Function

Related Documents

Numerical
December 2019 24
Numerical
October 2019 21
Numerical
May 2020 7
Numerical
November 2019 26
Numerical Exam
June 2020 2

More Documents from "Pravat Satpathy"

Aim Star
June 2020 19
June 2020 18
June 2020 17