Question: Part 1 Write a function called payment to calculate the payment for a loan. There are three parameters needed: length of loan in years t

Part 1 Write a function called payment to calculate the payment for a loan. There are three parameters needed: length of loan in years t, annual interest rate, r, and the amount borrowed, P. The formula to find the payment is
p=r12P1-(1+r12)-12t
where
p= payment
P= principle loan amount
r= annual interest rate (as a decimal)
t= time in years
The function definition should begin like:
def payment(rate, years, principle):
# your implementation code goes here
Part 2 Write a function called totalOfPayments to calculate the total amount paid for the loan after the loan is paid. The formula is
T=p12t
where
p= payment
t= time in years
The function definition should begin like:
def totalofPayments(rate, years, principle):
# your implementation code goes here
Hint: this function can call the payment O function to get p.
Page 1 of 2
Part 3 Write a function called financeCharge to calculate the total interest paid over the life of the loan. The formula is
I=T-P
where
P= principle loan amount
T= total of payments
The function definition should begin like:
def financeCharge(rate, years, principle):
# your implementation code goes here
Hint: this function can call the totalofPayments O function to get T.
All three functions should be saved in one file called loan_payment. py. Also include a program that calls these functions. Use the following values to test your three functions.
Test Values
rate APR)
years =5.0
principle =10000
Results
Payments: 211.93
Finance Charge: 2,715.78
Total: ,12,715.78
 Part 1 Write a function called payment to calculate the payment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!