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]
2 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]2 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
Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
Luden [163]

Answer:

The answer is A,B,D.

Explanation:

The answers: days of vacation time left

days of school left in the year & years of service someone performed

were correct on edgenuity. (IG:ixv.mona)

5 0
3 years ago
compare a 4 core processor 1.3ghz 8 megabytes 16ram and 2 terabyte hard drive to a 2 core 3.9 ghz 2 megabyte cache 4gb ram and 2
deff fn [24]

Answer:

answer is in the question

Explanation:

4 0
2 years ago
The ---------------initiates a message by encoding theidea (or a thought) in words or symbols and sends it to areceiver.ChannelS
saw5 [17]

Answer:

None of the given options

Explanation:

The sender initiates a message by encoding theidea (or a thought) in words or symbols and sends it to a receiver.

8 0
2 years ago
Submit your newsletter that includes the following: two or three columns a title at least three graphics, but not more than six
BigorU [14]

God Is Good He Will Always Help You He Is Good And Always Good!!

If God Is For Us Who Can Be Against us?? Romans 8:31

7 0
2 years ago
Read 2 more answers
How do big organizations take back their data to be reviewed after a disaster?
Jet001 [13]
Here a 5 step recovery plan, I have been in IT for 8 years

1. Create a disaster recovery team.

The team will be responsible for developing, implementing, and maintaining the DRP. A DRP should identify the team members, define each member’s responsibilities, and provide their contact information. The DRP should also identify who should be contacted in the event of a disaster or emergency. All employees should be informed of and understand the DRP and their responsibility if a disaster occurs.

2. Identify and assess disaster risks.

Your disaster recovery team should identify and assess the risks to your organization. This step should include items related to natural disasters, man-made emergencies, and technology related incidents. This will assist the team in identifying the recovery strategies and resources required to recover from disasters within a predetermined and acceptable timeframe.

3. Determine critical applications, documents, and resources.

The organization must evaluate its business processes to determine which are critical to the operations of the organization. The plan should focus on short-term survivability, such as generating cash flows and revenues, rather than on a long term solution of restoring the organization’s full functioning capacity. However, the organization must recognize that there are some processes that should not be delayed if possible. One example of a critical process is the processing of payroll.

4. Specify backup and off-site storage procedures.

These procedures should identify what to back up, by whom, how to perform the backup, location of backup and how frequently backups should occur. All critical applications, equipment, and documents should be backed up. Documents that you should consider backing up are the latest financial statements, tax returns, a current list of employees and their contact information, inventory records, customer and vendor listings. Critical supplies required for daily operations, such as checks and purchase orders, as well as a copy of the DRP, should be stored at an off-site location.

5. Test and maintain the DRP.

Disaster recovery planning is a continual process as risks of disasters and emergencies are always changing. It is recommended that the organization routinely test the DRP to evaluate the procedures documented in the plan for effectiveness and appropriateness. The recovery team should regularly update the DRP to accommodate for changes in business processes, technology, and evolving disaster risks.



summary :an organization must develop a recovery team to create a disaster recovery plan that includes identifying and assessing disaster risks, determining critical applications, and specifying backup procedures. Other procedures may be included in the plan based on the organization. The recovery team and organization must then implement the DRP and follow through on the plan procedures. The DRP should be continually tested and maintained to consistently prepare the organization for evolving disasters and emergencies.
4 0
2 years ago
Other questions:
  • The mathematical order of operations is used in Excel when formulas are evaluated. This order of operations states the order to
    9·2 answers
  • Help asap. 10 points.
    8·2 answers
  • Study and compare the tables and draw conclusions.
    13·1 answer
  • Jennifer's company currently uses Windows Active Directory to provide centralized authentication, authorization, and accounting
    14·1 answer
  • As Alexa types a message, Outlook autosaves the message at various points. In which folder is the message located if Alexa wants
    15·2 answers
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • Data ____ refers to the accuracy of the data in a database
    9·1 answer
  • Who wants brainlyest! NO LINKS how do you message someone on brainly
    10·2 answers
  • What is the answer???​
    6·1 answer
  • What will you see on the next line?<br> &gt;&gt;&gt;int(12.8)<br> ___
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!