Modify the compound interest program presented in my JS Control Statements and Loops slides (p. 16-18) so that it calculates and displays the amount of money in the account and the amount accumulated from the interest at the end of each year using an html form for the corresponding input and output. The input boxes can be labeled "Principal", "Rate" and "Years". The two output boxes can be labeled “Amount” and “Interest”. The form should provide also two buttons “Calculate” and “Clear” as shown below.
//Code to copy
<html>
<head>
<title>Web App for Compound Interest
Calculation</title>
<script type="text/javascript">
function calculate() {
p = document.getElementById("principal").value;
r = document.getElementById("rate").value;
t = document.getElementById("years").value;
n = 1;
// A = p * [[1 + (r/n)] ^ nt]
A = (p * Math.pow((1 + (r / (n * 100))), (n * t)));
//rounding to 2 decimal places
document.getElementById('amount').value =
A.toFixed(2).toString();
document.getElementById('interest').value = (A.toFixed(2) -
p).toFixed(2);
}
function clear() {
document.getElementById('principal').innerHTML = " ";
document.getElementById('rate').innerHTML = " ";
document.getElementById('years').innerHTML = " ";
document.getElementById('amount').innerHTML = " ";
document.getElementById('interest').innerHTML = " ";
}
</script>
<style>
div {
display: table-row;
}
label,
input {
display: table-cell;
}
</style>
</head>
<body>
<table style="width:100%" border="1" bgcolor="#c0c0c0">
<col align="right">
<col align="left">
<tr>
<td colspan="2" align="center">
<font color="blue">HOW YOUR INVESTMENT
GROWS</font>
</td>
</tr>
<tr>
<td>Principal</td>
<td><input id="principal"></td>
</tr>
<tr>
<td>Rate </td>
<td> <input id="rate"></td>
</tr>
<tr>
<td>Years </td>
<td> <input id="years"></td>
</tr>
<tr>
<td> Amount </td>
<td>
<input id="amount">
</td>
</tr>
<tr>
<td>Interest </td>
<td>
<input id="interest">
</td>
</tr>
<tr>
<td><button
onclick="calculate()">Calculate</button></td>
<td><button
onclick="clear()">Clear</button></td>
</tr>
</table>
</body>
</html>
---------------------------------------------------------------------
Sample Output:
Modify the compound interest program presented in my JS Control Statements and Loops slides (p. 16-18)...
I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) Budgetary Policy and Economic Growth Errol D'Souza The share of capital expenditures in government expenditures has been slipping and the tax reforms have not yet improved the income...