Question: Mortage calculator no php, only javascript . I am having a problem with my calculations after submitting, no calculations are returning. ----------index.php--------- Coulter Mortage Calculator

Mortage calculator no php, only javascript. I am having a problem with my calculations after submitting, no calculations are returning.

----------index.php---------

Coulter Mortage Calculator

Mortage Calculator

Loan Amount
Interest Rate (annual %)
Period in years

---------helper.js-------

function App(amount, APR, time) { this.amount = amount; this.APR = APR; this.time = time; this.monthlyRates = (this.APR / 12) / 100; this.yearsToMonths = this.time * 12; }

App.prototype.monthlyPayment = function() { p1 = (this.amount * this.monthlyRates); p2 = (1 - Math.pow((1 + this.monthlyRates), - this.yearsToMonths));

return (p1 / p2); }

App.prototype.totalInterest = function() {

return (this.monthlyPayment() * this.yearsToMonths - this.amount) }

App.prototype.roundToTwo = function(num) {

return +(Math.round(num + "e+2") + "e-2"); };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!