Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)-12i
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 ) 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 total OfPayments function to get T.
All three functions should be saved in one file called Loan_payment. py. Alsa include a program that calls these functions. Use the following values to test your three functions.
Test Values
rate =0.0989(9.89% APR)
years =5.0
principle =10000
rate =0.119,(11.9% APR)
years =2.0
principle =35000
\table[[Results],[Payments:,21193],[Finance Charge,2.7157],[Total:,12,7157],[,],[,],[Payments,1,645],[Finance Charg,4,50],[Total,3950]]
image text in transcribed

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

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago