Answered step by step
Verified Expert Solution
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 Write a function called payment to calculate the payment for a loan. There are three parameters needed: length of loan in years annual interest rate, and the amount borrowed, The formula to find the payment is
where
payment
principle loan amount
annual interest rate as a decimal
time in years
The function definition should begin like:
def paymentrate years, principle:
# your implementation code goes here
Part Write a function called totalofPayments to calculate the total amount paid for the loan after the loan is paid. The formula is
where
payment
time years
The function definition should begin like:
def totalofpaymentsrate years, principle:
# your implementation code goes here
Hint: this function can call the payment function to get
Page of
Part Write a function called financeCharge to calculate the total interest paid over the life of the loan. The formula is
where
principle loan amount
total payments
The function definition should begin like:
def financechargerate years, principle:
# your implementation code goes here
Hint: this function can call the total OfPayments function to get
All three functions should be saved in one file called Loanpayment. py Alsa include a program that calls these functions. Use the following values to test your three functions.
Test Values
rate APR
years
principle
rate APR
years
principle
tableResultsPayments:Finance Charge,Total:PaymentsFinance Charg,Total
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started