Question: For this assignment you will write a program to calculate the monthly payments required to pay back a student loan. You will need to prompt

For this assignment you will write a program to calculate the monthly payments required to pay back a student loan. You will need to prompt the user for the following values:For this assignment you will write a program to calculate the monthly

Total loan amount in dollars (principal) Annual interest rate (as a percentage) Number of years to repay loan and display the output in a readable form. Output should include Amount of monthly payment Total amount paid Total interest paid The formula for calculating monthly payments is given by p P(i /12) P1- +/12)- where p, P, i, n are the monthly payment amount, the principal loan amount, the annual interest rate as a fraction, and the number of monthly payments respectively. In your program, use appropriate names for your variables that are descriptive, and also be sure to comment your code Because it will be some time before we learn how to format output, use the int0 function to get approximate values for your output and to make it look better(and also to make your answers correct for the auto-grader which is a bit picky!) Here's an example you should use to test your program, i.e, you should get the same output values for the given input values: Enter the amount you owe [no commas]: 30000 Enter the interest rate [%]: 6 Enter the number of years you want to spend to pay back your loan: 10 Your monthly payment is $333. The total amount you ended up paying is $39967 The total amount of interest you paid is $9967. urivTY | 3.4.1: ZyLab PA #1 : Shira's Handy Dandy Student Loan Repayment Calculator (A Cautionary Program) 0,15 zypa1.py 1 loan-ant float(input()) 2 int rate float(inputO) 3 num years float (input('n)) 4 payment amnt float((loan amt(int_rate/12))/(1-(1 int_rate/12)-12 num years))

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!