Mortgage Payment Calculator is a tool to calculate the monthly repayment for a fixed rate mortgage. The calculator is written in Java programming language (Java Applet) and can be ran at any web browser. You must have Java plug-in installed on your computer in order to run this web application.
The main purpose of writing this application is so that I can use this tool to calculate the repayments for loan of purchasing a property (mortgage monthly repayment) at any place, any time.
Mortgage Payment Calculator is written base on fixed rate mortgage formula. The formula for fixed rate mortgage is
c = (r / (1 − (1 + r) − N))P0
Where
- c – fixed monthly payment
- r – (fixed yearly nominal interest rate) /(100 x 12)
- P0 – principal
- N – number of monthly payments (Which is equal to the mortgage terms in years x 12 months)
In Mortgage Payment Calculator, the main function that calculates the fixed monthly payment is as below. The function receives the following parameters: principle, yearly nominal interest rate and terms (in years); and return the monthly repayment value.
public double calculateMonthlyPayment( double principle, double rate, int terms ) { int i; int months; double mRate; double pow; mRate = rate / 12 / 100; months = terms * 12; pow = 1.0; for (i = 0; i < months; i++) { pow *= (1.0 + mRate); } return (1.0 - 1.0 /(1 - pow)) * mRate * principle; }
Mortgage Payment Calculator takes the parameters “price of property” and “down payment” instead of “principle”. In this case (housing loan), the “principle” is actually equals to the “price of property” minus the “down payment”.
You can put this tool on your website too by simply copy the following code and past into your web page source file.
<applet code="MortgagePaymentCalculator.CalculatorApplet" codebase="http://tools.snippetit.com/applet/" archive="MortgagePaymentCalculator.jar" width="320" height="240"> <param name="property_price" value="200000" /> <param name="loan_terms" value="30" /> <param name="interest_rate" value="6.00" /> <param name="down_payment" value="10000" /> </applet>
The parameters in the applet tag are optional. They serve as the default values for the calculator during application start-up.
[…] Your can put the little program at your website too. Simple get the code at Mortgage Payment Calculator. […]