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...
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs...
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs for customer entry for the following: Entry field (with labeling) for the Customer's name Entry field (with labeling) for the Customer's email address Entry field (with labeling) for which room the customer is planning on painting Entry field (with labeling) for the width of the room Entry field (with labeling) for the length of the room Entry field (with labeling) using a colour box...
[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...
Build a html form (making use of CSS and Javascript) with the following elements. The form...
Build a html form (making use of CSS and Javascript) with the following elements. The form must have validations and within a table format. • Name: a text box where the content must start with 1 upper case characters and no special character (i.e. !, @, #, $, %, &, *). Number is not allowed. The text box must not be empty. • Module code: a text box where the content must start with 3 lower case alphabets and follows...
Create a form with two inputs name and roll number.And write a script to validate the...
Create a form with two inputs name and roll number.And write a script to validate the inputs.Any of them should not be empty. Name will be string and roll number will be number between 1 -10 only
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...
Utilizing PHP and HTML code Create a form that has text inputs for two numbers and...
Utilizing PHP and HTML code Create a form that has text inputs for two numbers and a submit button. Submit the values to a program that calculates and displays the GCD of the two numbers. The greatest common divisor of two integers a and b is the largest integer that is a factor of both a and b. The GCD of any number and 1 is 1, and the GCD of any number and 0 is that number. For example:...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT