Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in python code please Task 4: Student Loan Calculator Again Next you're going to modify your Student Loan Repayment Calculator program to use functions As
in python code please
Task 4: Student Loan Calculator Again Next you're going to modify your Student Loan Repayment Calculator program to use functions As a reminder, the equation for a monthly payment is given by: P(i/12) 1- (1 i/12)-n where p is the monthly payment, P is the loan amount, is the annual percent interest rate (must be a fraction in the program), and n is the number of monthly payments. Write a program to calculate the monthly amount you owe, the total amount you'll end up paying, and the total amount of interest you'll have paid. The program must include the following . Global variables for the interest rate (a float), number of monthly payments (an integer), and amount of loan principal (P, a float) . A function calc.monthly-pymt () that calculates your monthly payment To print the dollar amounts, use string formatting rather than truncating the amounts as integers For example, ! >>> iou 25 * 22 >> iou 3 78.57142857142857 4 >>> print(, I owe you $%0.2f., % iou) s I owe you $78.57. Here's an example of my output i Enter the amount you owe [no commas]30000 2 Enter the interest rate [%]: 6.8 3 Enter the number of years you want to spend to pay back your loan: 10 s Your monthly payment is $345.24 6 The total amount you ended up paying is $41428.92 7 The total amount of interest you paid is $11428.92Step 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