1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tamaranim1 [39]
3 years ago
8

A file named loan.html, write an HTML document that looks similar to figure 9-7 in the textbook. Write four functions with these

headers:
function doPayment ( )
function doBalance ( )
function computePayment (principal, annualRate, years, periodsPerYear)
function computeBalance (principal, annualRate, years, periodsPerYear, numberOfPaymentPaidToDate)
The first two functions (doPayment and doBalance) do the following:

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 d payments have been made is

b = a (1 + r)d − p ( (1 + r)d − 1 )
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 d is the number of payments paid to date.
Computers and Technology
1 answer:
jok3333 [9.3K]3 years ago
6 0

Answer:

function computePayment(principal, annualRate, periodsPerYear){

   var pay;

   pay = (principal * annualRate)/(1-(1+annualRate)-periodsPerYear);

   return pay;

}

function computeBalance(principal, annualRate, periodsPerYear, numberOfPaymentsPaidToDate){

   var balance ;

   let num = (principal*(1+annualRate)*periodsPerYear);

   let denum = numberOfPaymentsPaidToDate *((1+annualRate) * periodsPerYear-1)*annualRate;

   balance = num-denum;

   return balance;

}

function doPayment(){

   let loanAmount = document.getElementById("principal").value;

   let rate = document.getElementById("rate").value;

   let duration = document.getElementsById("time").value;

   let result = computePayment(loanAmount, rate, duration);

   document.getElementsById("periodPay").value = result;

}

function doBalance(){

   let loanAmount = document.getElementById("principal").value;

   let rate = document.getElementById("rate").value;

   let duration = document.getElementById("time").value;

   let currentPaid = document.getElementById("paidMonths").value;

   let result = computeBalance(loanAmount, rate, duration, currentPaid);

   document.getElementById("displayBalance").value = result;

}

Explanation:

The javascript source code defines four functions. The 'doPayment' and 'doBalance' functions are initiated with the onclick properties of the HTML file buttons of the loan calculator. The doPayment function gets the user input from the HTML file and assigns them to variable which are used as the parameters of the computePayment function called.

The doBalance function also retrieve user input from the HTML file and calls the computeBalance function to calculate and return the balance of the loan to be paid.

You might be interested in
An acceptable website design is one that meets
Harman [31]

Answer:

i'd say b

Explanation:

5 0
2 years ago
Read 2 more answers
URGENT!!!
Alona [7]

False is your answer

5 0
3 years ago
Read 2 more answers
Arturo is a security professional. He is strengthening the security of an information system. His design ensures that if a field
Cloud [144]

Arturo is attempting to protect the database (data) of an information system (IS).

<h3>What is an information system?</h3>

An information system (IS) can be defined as a set of computer systems, that is typically used to collect, store, and process data, as well as the dissemination of information, knowledge, and the distribution of digital products.

In Cybersecurity, there are two (2) main techniques that can be used to check data when inputted in an information system (IS) and these include:

  • Verification
  • Validation

Data validation is a type of check which is primarily performed by a software program (application) to make sure that the data which is entered into an information system (IS) is allowable and sensible.

This ultimately implies that, any data that is not allowed or sensible are rejected and discarded by the computer system.

In conclusion, we can deduce that Arturo is attempting to protect the database (data) of an information system (IS).

Read more on data here: brainly.com/question/25885448

3 0
2 years ago
When microsoft released word for windows, wordperfect had about 80 percent of the word processing market. microsoft donated free
irina1246 [14]

When Microsoft donated copies of Word program to colleges and universities, the company Microsoft is using a Marketing Strategy in promoting the product. A good promotion will help the product to be known and by words of mouth it will basically promote the product and the users will definitely give comments on how the product performs.

7 0
3 years ago
What is Data validation? (in a simple definition)
dlinn [17]
Verify data, something like this

var username = document.getElementById("input1").value

var password = document.getElementById("input2").value

// this is the validation:
if ( username == "anime" && password == "Anime132" ){
alert("Correct login data");
} else {
alert("Wrong login data");
}
7 0
3 years ago
Read 2 more answers
Other questions:
  • A customer service representative for an Internet provider uses various techniques to help a frustrated customer with a slow Int
    13·1 answer
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • What method of malware infection installs malware through use of a separate browser window that opens uninvited from a Web page?
    7·2 answers
  • Discuss why mtv initially had a difficulty securing enough ads
    10·1 answer
  • What advantage do ExpressCard modules and U.S.B adapters offer over expansion cards?
    10·1 answer
  • which of the following is a malicious program that can replicate and spread from computer to computer? A. Email B. Virus C. Spam
    15·1 answer
  • Explain the distinction between interpretation and compilation. What are the comparative advantages and disadvantages of the two
    11·1 answer
  • When comparing different biometric systems, one of the most important metrics used is called the _________, which represents the
    14·1 answer
  • Hey, how is everyone????????????????????????????????
    8·2 answers
  • Outline the dangers arising as a result of using computers​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!