Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help this code is not computing correctly. There must be something wrong with the formula. I can't figure it out. Here is the criteria

Please help this code is not computing correctly. There must be something wrong with the formula. I can't figure it out.

Here is the criteria for the assignment:

Write four functions with these headers:

function doPayment() function doBalance() function computePayment(principal, annualRate, years, periodsPerYear) function computeBalance(principal, annualRate, years, periodsPerYear, numberOfPaymentsPaidToDate) 

The first two functions (doPayment and doBalance)

take no parameters

are called from an onclick attribute

get input from the user

call the computePayment or the computeBalance function

display a result to the user

The computePayment function computes and returns the monthly payment for a loan with a fixed annual interest rate. The formula for computing a loan payment is

P = ar/1(1+r)^n

where p is the payment per period, a is the loan amount, r is the interest rate per period, and n is the total number of periods throughout the life of the loan.

The computeBalance function computes and returns the balance for a loan with a fixed annual interest rate. The formula for computing the balance of a loan after n payments have been made is

b =a(1+r)^n p((1+r)^n1)/r

where b is the balance or payoff amount, a is the loan amount, r is the interest rate per period, p is the payment per period, and n is the number of payments paid to date.

Loan Calculator

Loan Calculator

Amount borrowed (Principal) :
Annual Interest Rate (for example 0.065)
Number of years
Payments per years
Number of payment paid to date

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions