Board Logo
« The Time/Payment Formula (Loan Amortization) »

Welcome Guest. Please Login or Register.
Jan 18th, 2018, 3:52pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

This board is not meant for general discussion, it is meant for posting articles to help others.
For general discussions use the appropriate board, which best describes your problem area.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: The Time/Payment Formula (Loan Amortization)  (Read 5208 times)
Welopez
Moderator
ImageImageImageImageImage


member is offline

Avatar

Never let your beliefs get in the way of learning.


PM

Gender: Male
Posts: 4407
xx The Time/Payment Formula (Loan Amortization)
« Thread started on: Nov 29th, 2008, 12:06pm »

Some people do not fully understand the time payment formula. Only three values are needed:
     A = the amount borrowed
     N = the number of payments to be made
     R = the interest rate for repayment.

The formula is: payment = A*R/(1-(1+R)^(N*-1))

A simple program might look like:
Code:
INPUT "Amount? "; A
INPUT "Yearly Rate? "; R
IF R > 1 THEN R=R/100
R=R/12
INPUT "Months to Repay? "; N
payment = A*R/(1-(1+R)^(N*-1))

PRINT payment

END
 

Entering the amount borrowed should be simple for any user. The yearly rate might be entered at 12.9, but more properly should be .129. The IF/THEN comparison checks to see if the amount entered is greater than 1, if so it is divided by 100. Since payments will be made every month, we want to divide the yearly rate by 12 to obtain the monthly rate. In the time payment formula, N is the number of months, and to obtain a decreasing value, N*-1 is used.

The time payment formula shows the user how much each payment will be. To make our program more informative, we'll use a FOR/NEXT loop and display the number of the payment, the interest paid for this month, the amount to reduce the amount owed for this month, and the remaining balance.
Code:
'Amortization Schedule

INPUT "Amount? "; A
INPUT "Yearly Rate? "; R
IF R > 1 THEN R=R/100
R=R/12
INPUT "Months to Repay? "; N
payment = A*R/(1-(1+R)^(N*-1))

PRINT "Monthly payment equals $"; USING("#####.##",payment)
PRINT
PRINT "Month", "Int. Pd.", "Prin. Pd.", "Balance"  'Column headings

FOR k=1 TO N
    curInt=A*R                   'This months interest payment
    curPrin=payment-curInt       'This months principle payment
    A=A-curPrin                  'Balance minus this months principle
    PRINT k,_
    USING("#####.##", curInt),_
    USING("#####.##", curPrin),_
    USING("#####.##", A)
NEXT k

END
 

Now that we know how much we will pay every month, we can calculate how much of that payment will go for renting the money, curInt, how much will go to reduce the debt, curPrin, and how much the balance will be after subtracting this month's curPrin.

Notice the amount of interest will decrease every month as the length of time we will rent the money decreases; also the amount toward principle will increase, though monthly payments remain the same. Payment = curInt + curPrin.

For those without experience in printing tables, PRINT means to advance to the next line. It is not necessary to tell the computer what to print. PRINT k, curInt, curPrin, A tells the computer to print multiple values, beginning with the next print zone (14 spaces when using Just Basic) on the same line.

The logical line extension (_) allows us to place the code for each value on a separate program line, but when printed to the screen they will be treated as a single line.

PRINT USING("#####.##", curInt) means the value current interest will be printed with a maximum of five digits plus two decimal digits. The same format is used for curPrin and A (balance remaining) with every pass through the FOR/NEXT loop.


« Last Edit: Nov 30th, 2008, 1:58pm by Welopez » User IP Logged

JB 1.01
Win7 64bit, 4 GB RAM, Pentium 6200@2.13 GHz (laptop)
WinXP, 1 GB RAM, Intel N270@1.6 GHz (netbook)
Ralph
New Member
Image


member is offline

Avatar




PM


Posts: 12
xx Re: The Time/Payment Formula (Loan Amortization)
« Reply #1 on: Oct 17th, 2011, 09:54am »

Well done Welopez! Can you show us your code for using it in GUI, as you said you'd done? Appreciated.
« Last Edit: Oct 17th, 2011, 09:55am by Ralph » User IP Logged

Jimmu
Junior Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 119
xx Re: The Time/Payment Formula (Loan Amortization)
« Reply #2 on: Oct 17th, 2011, 11:54am »

I did something like this and found it didn't match with what the bank calculated because they did daily compounding of interest for 28, 29, 30, or 31 days depending on how many days in the month. Life is never as simple as it should be. :->
User IP Logged

I know many things. Some of them are even true!
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls