Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:image text in transcribed

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

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

=+ Are some laws more important than others? If so, which ones?

Answered: 1 week ago

Question

=+j Describe how EU directives impact IHRM.

Answered: 1 week ago