Summary Create a dynamic web page that allows users to compare different financi
ID: 3585640 • Letter: S
Question
Summary Create a dynamic web page that allows users to compare different financing offers for an automobile loan. Purchasers are often presented with different financing offers, and determining the best offer can be difficult. In particular, dealers often have promotions that offer either a lower interest rate or a cash incentive (sometimes called a manufacturer rebate) that reduces the amount financed. Submission Requirements Your web page must be submitted to the D2L as a ZIP, 7z, or TGZ archive. You must also demo your webpage to the instructor during office hours within 2 weeks after the D2L submission deadline Clarfications Some requirements are intentionally vague, and some may be unintentionally vague. Please post any questions about the requirements are requests for clarification to Piazza. Grading Grading for this extra credit assignment will functionality, good practices for HTML/CSS/JavaScript, and modern visual appearance. Please note that visual appearance may be subjective be based on This assignment should be completed individually, not as a group or with assistance from your classmates. Functionality The web page will allow a user to enter the purchase price for the vehicleExplanation / Answer
Solution:
(1) Make 4 text fields and 1 "Add option" button in html page.
<input type="text" id="purchase">
<input type="text" id="cashIncentive">
<input type="text" id="term">
<input type="text" id="rate">
<input type="button" id="addoption" value="Add option">
(2) Validate text fields.
var purchase = $("#purchase").val();
if (purchase >= 0 && purchase <=100000)
{
alert("Please enter valid purchase price.")
}
var term = $("#term").val(); // monthly
if (term >= 24 && term <=72)
{
alert("Please enter valid term in months.")
}
var interestRate = $("#rate").val();
if (interestRate >= 0.0 && interestRate <=10.0)
{
alert("Please enter valid interest rate.")
}
var cashIncentive = $("#cashIncentive").val();
(3) Calculate monthly payment and total cost:
var purchase = $("#purchase").val();
var term = $("#term").val(); // monthly
var cashIncentive = $("#cashIncentive").val();
var interestRate = $("#rate").val();
if(cashIncentive != "")
{
purchase = purchase - cashIncentive;
}
var termIntRatio = (interestRate/100)/12;
var termInterest = (termIntRatio*interestRate);
var top = Math.pow((1+termIntRatio),term);
var bottom = top -1;
var sp = top / bottom;
var monthly = ((purchase * termIntRatio) * sp);
var monthly = monthly.toFixed(2);
var totalcost = monthly*term;
(4) Make offers counter variable to count the offers on "Add option" button and delete offers to display Offer 1, Offer 2 etc.
(5) Use in <div> of specific offer for display in box.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.