I am trying to create a monthly mortgage calculator, I have been able to make it show prompts for Amount of loan; Interest rate; and Term of loan (in months), but it will not display the results. Below is the code I have utilized to get this far. Any and all help will be appreciated.
Thx
<html>
<head>
<title>Mortgage Payment Calculator</title>
</head>
<body bgcolor=blue text=yellow>
<body>
<!output the name, date, time header, with a horizontal line between this heading and the
body of the web page>
<script language=“JavaScript”>
document.write(‘<center><h3>–David Brown–’);
myDate=new Date();
document.write(myDate.toLocaleString());
document.write(‘</h3></center><hr>’);
</script><br>
<body>
<html>
<script type=“text/javascript”>
loan=prompt("Amount of loan","");
interest_rate=prompt("Annual interest rate (%)","");
months=prompt("Term of loan (months)","");
rate=interest_rate / 100 /12;
payment=loan * (rate / (1- (1 / math.pow((1+ rate), months))));
payment=math.round(payment*100)/100;
document.write(“loan amount:”,loan,“<br>”);
document.write(“interest rate:”,interest_rate,“% per annum”,“<br>”);
document.write(“Term:”, months,“months”,“<br>”);
document.write(“Monthly payment:”,payment);
</script>
</body>
</html>