Overview
Challenge
Write a mortgage loan calculator application that takes in three parameters:
- The amount of money loaned in pounds (balance)
- The time over which the loan will be repaid, in months (term)
- The percentage rate at which interest will accrue on the loan (rate)
The output should include the following:
- The month (1 corresponding to the 1st month of payment, through the total number of months)
- The payment amount
- The principal paid this month
- The interest paid this month
- The total interest paid to date
- The remaining loan balance at the end of the month
Formulas Used
Total Monthly Payment = (amount loaned) * (rate/1200) / (1 – (1 + rate/1200)(-Number of Months) )
The Remaining Balance before the very first month equals the amount of the loan.
Interest Payment = Previous Remaining Balance * rate/1200
Principal Payment = Total Monthly Payment - Interest Payment
At the end of each month, Remaining Balance = Previous Remaining Balance - principal payments
Features
- CSS and BootStrap Layout
- DOM Manipulation
- Event Listeners
- For Loops
- Functions
- HTML Templating
- If Statements
- String Methods
- Type Casting
Tech Stack
- HTML5
- CSS3
- Bootstrap
- TypeScript