Question: I need help getting my stuff to display using inputs and a dropdown. Loan Amortization principal interestRate 36 months 24 months 12 months Submit document.writeln(amort()_;

I need help getting my stuff to display using inputs and a dropdown.

Loan Amortization

principal interestRate

function amort() { var terms = document.getElementById("aa").value; var balance = document.getElementById("ab").value; var interestRate = document.getElementById("ac").value;

var monthlyRate = interestRate/12; var payment = balance * (monthlyRate/(1-Math.pow( 1+monthlyRate, -terms))); var result = "Loan amount: $" + balance.toFixed(2) + "
" + "Interest rate: " + (interestRate*100).toFixed(2) + "%
" + "Number of months: " + terms + "
" + "Monthly payment: $" + payment.toFixed(2) + "
" + "Total paid: $" + (payment * terms).toFixed(2) + "

"; result += "

" + ""; for (var month = 1; month <= terms; month++){ var monthlyInterest = 0, monthlyPrincipal = 0; result += ""; result += ""; result += ""; monthlyInterest = balance * monthlyRate; result += ""; monthlyPrincipal = payment - monthlyInterest; result += ""; balance = balance - monthlyPrincipal; result += ""; } result += "
MonthBalanceInterestPrincipal
" + (month) + " " + balance.toFixed(2) + " " + monthlyInterest.toFixed(2) + " " + monthlyPrincipal.toFixed(2) + "
"; return result; }

it should display

month balance interest Principal
1 6000.00 42.50 480.83
2 5519.18 39.09 484.22
3 5034.96 35.66 487.65
4 4547.30 32.21 491.11
5 4056.19 28.73 494.59
6 3561.61 25.23 498.09
7 3063.52 21.70 501.62
8 2561.90 18.15 505.17
9 2056.73 14.57 508.75
10 1547.97 10.96 512.35
11 1035.62 7.34 515.98
12 519.64 3.68 519.64

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!