Question

Code a website you will have multiple inputs on the page (do not use the prompt...

Code a website you will have multiple inputs on the page (do not use the prompt function): You will need to ask for the following (in this order): Ask for their name. Ask for the Amount of Money to borrow: Ask for the Length of Time (Years) Ask for the Annual Interest Rate Use the either of these formulas for getting the payment: P = ((r/12) * PV) / (1 - (1+(r/12))**-(n*12)); P = ((r/12) * PV) / (1 - Math.pow((1 +(r/12), -n*12))); At the bottom of the form, you will need to have the Name and Resulting payment. Stated some like this , {Name}, if you do a $ ______ loan for _____ years at ____ interest. Your monthly payment will be: _________ The format of the $ amount should look good (like money such as $68.27).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Write the code in a .html file and open it in a web browser.

CODE:

<!DOCTYPE html>

<html>

<head>

  <title>Document</title>

</head>

<body>

    Enter your name :

    <br><input type="text" id="name"><br><br>

    Enter Amount of money to borrow :

    <br><input type="number" id="amount"><br><br>

    Enter Time(in years) :

    <br><input type="number" id="time"><br><br>

    Enter Annual interest rate :

    <br><input type="number" id="rate"><br><br>

    <button onclick="calculatePayment()">Calculate Payment</button>

    <h3 id="output"></h3>

  <script>

    function calculatePayment() {

      var name = document.getElementById("name").value;

      var PV = document.getElementById("amount").value;

      var n = document.getElementById("time").value;

      var r = document.getElementById("rate").value;

      var P = ((r/12) * PV) / (1 - (1+(r/12))**-(n*12));

      P=Math.round( P * 100 + Number.EPSILON ) / 100;

      document.getElementById("output").innerText = `${name}, if you do a $${PV} loan for ${n} years at ${r} interest.

        Your monthly payment will be: $${P}`;

    }

  </script>

</body>

</html>

SCREENSHOT:



SAMPLE OUTPUT:

***Please upvote if it helps and feel free to comment if you have any query

Add a comment
Know the answer?
Add Answer to:
Code a website you will have multiple inputs on the page (do not use the prompt...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JAVA You have been scrimping and saving and are now looking to buy a new car....

    JAVA You have been scrimping and saving and are now looking to buy a new car. You decided you want to buy a Honda Civic because of its good gas mileage, good trade in value and available features. Now you get to choose a package of options. Base price: $17,950 The car comes with these different option packages: Option ‘P’ includes: auto transmission, power windows and locks, stereo sound system. Cost: base + 1200 Option ‘L’ includes: all of the...

  • 6. -/6 points CraudColAlg6 1.1.EX.017. 0/100 Submissions Used My Notes + Ask Your Teacher When you...

    6. -/6 points CraudColAlg6 1.1.EX.017. 0/100 Submissions Used My Notes + Ask Your Teacher When you borrow money to buy a house or a car, you pay off the loan in monthly payments, but the interest is always accruing on the outstanding balance. This makes the determination of your monthly payment on a loan more complicated than you might expect. If you borrow P dollars at a monthly interest rate of r(as a decimal) and wish to pay off the...

  • THE PROBLEM: The nice folks from the Lion Lending Company have hired you to write some...

    THE PROBLEM: The nice folks from the Lion Lending Company have hired you to write some software that will process their daily loan information. The data will come from a text file that has the following format: The first line will contain an integer: number of loan applications There will be two rows for each of the customers First line will be the customer's (1) first name and (2) last name, separated by a space (assume there is no spaces...

  • Give the project a meaningful name. Write a main method to test a new static method...

    Give the project a meaningful name. Write a main method to test a new static method used to compute a monthly payment on a loan. The new static method used to compute the monthly payment for a loan uses this formula: m = p_0 middot r middot (1 + r)^n ((1 + r)^n - 1) Where m is the monthly payment, P_0 is the initial loan amount, r is the monthly interest rate, and n is the number of monthly...

  • Programming language: PYTHON Prompt: You will be creating a program to show final investment amounts from...

    Programming language: PYTHON Prompt: You will be creating a program to show final investment amounts from a principal using simple or compound interest. First, get a principal amount from the user. Next, ask the user if simple or compound interest should be used. If the user types in anything other than these options, ask again until a correct option is chosen. Ask the user to type in the interest rate as a percentage from 0 to 100%. Finally, ask the...

  • c++ and please add tables and everything and make sure program is complete. Write a menu...

    c++ and please add tables and everything and make sure program is complete. Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a filo Menu will be the following Enter (1) to calculate your loan monthly payment Enter (2) to calculate your loan monthly payment & write to a file Tips: Compound Interest Formula A =...

  • You win the lottery! Do you wish to receive $2,000,000 in one payment now, or $167,000...

    You win the lottery! Do you wish to receive $2,000,000 in one payment now, or $167,000 per year for 30 years? To help you in your decision, estimate the present value of the second option assuming constant annual interest rates of 6%, 8%, and 10%. Expound on your decision within a text box. (You may use the built-in PV function within Excel) Loans: where: and, interest due at the end of each month A = payment P = principal (amount...

  • how doni do this in excel and what is the interest rate? Suppose that you wish to purchase a car and that your bank...

    how doni do this in excel and what is the interest rate? Suppose that you wish to purchase a car and that your bank is offering to you a loan. You wish to explore the nature of this loan and the payments that you would have to make given certain circumstances such as the amount that you borrow. Fortunately, Excel offers a function (PMT) that calculates the payment for a loan based on constant payments and a constant interest rate....

  • THE QUESTION IS THAT I NEED A NARRATIVE ANALYSIS.............ON PROBLEM 3. I HAVE THE ANSWER I...

    THE QUESTION IS THAT I NEED A NARRATIVE ANALYSIS.............ON PROBLEM 3. I HAVE THE ANSWER I NEED THE NARRATIVE ANALYSIS AND WHAT WOULD YOU RECOMMEND TO THE COMPANY. PLEASE DO NOT WRITE OUT THE ANSWER THAT I ALREADY HAVE. How many years will it take for $197 million to grow to be $554 million if it is invested in an account with a quoted annual interest rate of 5 percent with monthly compounding of interest? Question 1 Monev at the...

  • Section 4 - Mortgage Calculation Instructions You Have Decided to use a 15 year Amortization for...

    Section 4 - Mortgage Calculation Instructions You Have Decided to use a 15 year Amortization for your Mortgage. Use this information to find the MONTHLY mortgage PAYMENT using the mortgage amount from previous section and a rate of 3.17%. You must also determine the amount of INTEREST, PRINCIPAL and BALANCE owing for the mortgage after 4 Years and 1 Months. Input all the TVM variables and answers into the fields below. Amortization Mortgage Amount From Previous Question $278710.23 15 Years...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT