Question

In: Computer Science

Do for javascript. Create a form with the following inputs. L -> Loan Amount in $'s,...

Do for javascript.

Create a form with the following inputs.

L -> Loan Amount in $'s, i -> Interest Rate %/year, n -> Number of Compounding Periods months

Given the following formula to solve for the monthly payments

mp = ( i * (1+i)^n * L ) / ( (1+i)^n - 1 )

Output the results

L = $, i = %/month , n = months

mp = $

And a table which lists the remaining loan amount and interest paid per/month

Month Loan Remaining Interest Paid

Solutions

Expert Solution

note : code is in JS and html

given integers in formula and given data/labels are not match................so formula will not work with given data(it also doesn't have % input).

given code will help you..........

<html>

<head>

<title>compound interest calculation</title>

<script>

function calculate()

{

p = document.getElementById("p").value;

n = document.getElementById("n").value; // no. of compound per year

t = document.getElementById("t").value; //no. of years

r = document.getElementBuId("r").value;

result = document.getElementById("result");

// The equation is A = p *[[1 + (r/n)] ^ nt]

A = (p* Math.pow((1 + (r/(n*100))), (n*t)));

// tofixed is used for rounding the amount with two decimal places. result.innerHTML = "the total amount is " + A.tofixed(2);

result.innerHTML += "<br> the interest is " + (A.to Fixed(2) - p).toFixed(2);

}

</script>

<style>

div

{

display: table-row;

}

lable, input

{

display: table-cell;

}

</style>

</head>

<body>

<h1>compound interest</h1>

<div> <label>Amount: </label> <input id="p"> </div>

<div> <label>Rate (%): </label> <input id="r"> </div>

<div> <label>No. of Years: </label> <input id="t"> </div>

<div> <label>Computing times per year: </label> <input id="n" value="1">

<button onclick="calculate()">calculate</button>

<p id="result"></p>

</body>

</html>


Related Solutions

Create a JavaScript function that will collect the information from the form and verify that it...
Create a JavaScript function that will collect the information from the form and verify that it is the correct type and that there are no blank textboxes. Save and test the file to ensure that the textbox information is collected and the script is working correctly. Use the onclick event within the submit button to call this function. Output validation error messages by writing directly to the with the id of "results." (You may want to use alert boxes for...
I'm trying to create a javascript order form that outputs the items/cost/quantity in the form of...
I'm trying to create a javascript order form that outputs the items/cost/quantity in the form of a table. I have to use a for loop to accomplish this, but I'm not sure where to place the loop & what it needs to reference <!DOCTYPE html> <head> <meta charset="utf-8" /> <style media="screen"> div{ background-color: #f7df3e; border: 1px solid black; padding: 10px; margin: 30px; } h1{ text-align: center; } </style> <script type="text/javascript"> var items = []; var quans = []; var costs...
[Javascript] Create a function that gets the total amount and percentage of covid case data for...
[Javascript] Create a function that gets the total amount and percentage of covid case data for each Age Group in the covid cases data set(which contains the property "Age Group" in each case array). Age Groups: 'younger than 18', 'between 19 to 28 Years', 'between 29 to 38 Years','between 39 to 48 Years','between 49 to 58 Years','between 59 to 68 Years','between 69 to 78 Years','between 79 to 88 Years', and'older than 89' the function getSummaryOfAges(data) should return an Object with...
my question is about 3.2.13 which is A loan of amount L is to be repaid...
my question is about 3.2.13 which is A loan of amount L is to be repaid by n payments, starting one period after the loan is made, with interest at rate I per period. Two repayment schemes are considered: i) level payments for the lifetime of the loan; ii) each payment consists of principal repaid of L/n plus interest on the previous outstanding balance. Find the total interest repaid under each scheme and show algebraically that the interest paid under...
A loan of amount L is to be repaid by n(n > 1) payments, starting one...
A loan of amount L is to be repaid by n(n > 1) payments, starting one period after the loan is made, with interest at rate i per period. Two repayment schemes are considered: (i) level payments for the lifetime of the loan; (ii) each payment consists of principal repaid of L n plus interest on the previous outstanding balance. (a) Find the total interest repaid under each scheme and show algebraically that the interest paid under scheme (i) is...
A loan amount of L is amortized over six years with monthly payments (at the end...
A loan amount of L is amortized over six years with monthly payments (at the end of each month) at a nominal interest rate of i(12) compounded monthly. The first payment is 500 and is to be paid one month from the date of the loan. Each subsequent payment will be 1% larger than the prior payment. (a) If i(12) = 9%, find the principal repaid in the 25th payment. (b) If i(12) = 12%, find the amount of loan...
Calculate the amount of stock reagent(s) and water required to make the following solutions. A)2.5 L...
Calculate the amount of stock reagent(s) and water required to make the following solutions. A)2.5 L of 25 mM NaCl (from 250 mM stock), 1 mM EDTA (from 0.5 M stock) B)200 mL of 0.25 M Sodium Citrate (from dry powder), 20 mM SDS (from 0.5 M stock), 10% glycerol C)3.0 L of 25% Saroksyl
[Javascript] Create a function(returnObjectFromId(case, ...idNum)) to return the case Object(s) for a given idNum, or list...
[Javascript] Create a function(returnObjectFromId(case, ...idNum)) to return the case Object(s) for a given idNum, or list of idNums. Calling with a single `idNum` value should return the case Object, and return NULL if an id value that's unknown is passed returnObjectFromId(case, 84838) would return the Object in the cases Array with an 'idNumber' of id, and use the .find() method of the cases Array to locate items by idNumber. returnObjectFromId(cases, -23298312) would return null. returnObjectFromId(cases, 161020, 161021) would return an...
Mary and Paul are negotiating a mortgage loan with an S&L. The house has a sales...
Mary and Paul are negotiating a mortgage loan with an S&L. The house has a sales price of $360,000. Mary and Paul agree to put 20% down. The S&L presents to them two alternative financing options: Option 1 Option 2 30-year 7.0% fixed rate paying no points 30-year 6.8% fixed rate paying 1.8 points Assume Mary and Paul plan on living in the house for 30 years.   What is the Net Present Value of their savings?
Write a JavaScript function to get the values of form containing the following input fields: fname...
Write a JavaScript function to get the values of form containing the following input fields: fname lname address city state
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT