Loan payments are calculated according
to a non-homogeneous linear recurrance relation. The balance owed on a
loan is called
*principal*. The charge for the borrowed money is called
*interest*,
and it is calculated as a percentage of the principal. Interest is typically
published according to an annual rate, although it may be charged on a
monthly basis.
If we let **P** be the initial loan principal,
and let **R** be the annual interest rate, and let **N** be the number
of months over which the loan is to be repaid, then we can calculate the
monthly payment **M** according to the following formula:
Each month when a loan payment is made, therefore,
a portion of the payment is applied to interest while the remainder is
applied to principal. If the principal balance in month *n* is **P***n*,
then the interest amount levied that month is (**R**/12) * **P***n*.
Banks and tax accountants are keenly interested (heh, heh) in knowing how
much money each month is applied to each category.
Write a program to calculate loan payments
and display an amortization schedule. |