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
Recent advances in information technologies (IT) have powered the merger of online and offline retail channels into one single p
zmey [24]

Answer:

True

Explanation:

With the recent advancement in IT we have witnessed offline retail businesses begin to get online presence. The advancement of the e-commerce sector and the convenience that it brings to customers through providing the ability to make orders online and get goods delivered to their doorsteps in a short time, has brought about escalating growth in the online and in extension offline retail businesses.

Big retail chains such as Walmart are taking advantage of this to increase their sales. Also, online retail presence helps put offline businesses out there in terms of advertising and marketing.

3 0
3 years ago
CORRECT ANSWER GETS BRAINLIEST
guajiro [1.7K]

I saw that all of them are correct. In 1905, the Wright Brothers flew their plane for 39.5 minutes. In 1969, Neil Armstrong landed on the moon. And the Wright brothers went throughout the U.S and Europe to demonstrate their plane. I hope this helps.

7 0
3 years ago
Read 2 more answers
There is a natural tendency on the part of users and system managers to perceive little benefit from security investment until a
spayn [35]

Answer:

The answer is True

Explanation:

Users and system managers/administrators do not necessarily see the use of security investments, because there is no security breach or security failure to the system.

When security infrastructures are in place, it is to prevent or at least reduce the possibility of devaluation, modification, corruption, destruction or deletion, disruption, disclosure, use, and inappropriate or unauthorized access. So, if any of these breaches do not occur, system managers and users perceive little benefits from security investments.

6 0
3 years ago
Which of the following best explains how the Internet is a fault-tolerant system?
IrinaK [193]

Answer:

A

Explanation:

The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace.

This statement is actually the same question I had to answer when in my 2nd year 1st semester in itt.
<3 enjoy

8 0
2 years ago
Read 2 more answers
Who is a creator in the context of online photo sharing?
solniwko [45]
Image sharing, or photo sharing, is the publishing or transfer of a user's digital photos online. Image sharing websites offer services such as uploading, hosting, managing and sharing of photos (publicly or privately).[1] This function is provided through both websites and applications that facilitate the upload and display of images. The term can also be loosely applied to the use of online photo galleries that are set up and managed by individual users, including photoblogs. Sharing means that other users can view but not necessarily download images, and users can select different copyright options for their images.

While photoblogs tend only to display a chronological view of user-selected medium-sized photos, most photo sharing sites provide multiple views (such as thumbnailsand slideshows), the ability to classify photos into albums, and add annotations (such as captions or tags).

Desktop photo management applications may include their own photo-sharing features or integration with sites for uploading images to them. There are also desktop applications whose sole function is sharing images, generally using peer-to-peer networking. Basic image sharing functionality can be found in applications that allow you to email photos, for example by dragging and dropping them into pre-designed templates.

Photo sharing is not confined to the web and personal computers, but is also possible from portable devices such as camera phones, either directly or via MMS. Some cameras now come equipped with wireless networkingand similar sharing functionality themselves

photo-sharing website that helps people create an account this is answer


4 0
4 years ago
Read 2 more answers
Other questions:
  • In your own words, describe the advantages and disadvantages of the auto-negotiation protocol used in Ethernet communications.
    6·1 answer
  • What is Linux an example of
    6·1 answer
  • The main workplace of a Windows computer is called the
    14·1 answer
  • Visual Basics: 1 ) Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments
    9·1 answer
  • Three broad categories of cryptographic algorithms are commonly used to create PRNGs: symmetric block ciphers, asymmetric cipher
    8·1 answer
  • Host to IP address lookup and its reverse lookup option are very important network services for any size network. It is also how
    9·1 answer
  • Where Go to set up margins on a letter
    15·1 answer
  • Write a recursive function is_pow2(n) that returns True if the positive integer n is an integer power of 2, and False otherwise.
    9·1 answer
  • PLEASE HELP I WILL GIVE BRAINLIEST!!
    8·1 answer
  • Digital computers use a........ system to encode date and programs.<br>​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!