Question: Using PYTHON: Modify your mortgage to include two functions. A function to get principal, rate, and term. A function to calculate monthly payment. Test your
Using PYTHON:
Modify your mortgage to include two functions.
- A function to get principal, rate, and term.
- A function to calculate monthly payment.
Test your program by getting the data from the user by using the first function and calculate monthly payment by using other function. Write proper comments.
Input Validation: Do not accept negative values for loan amount (principal), rate, and term.
Loan amount should be between 100,000 and 1,000,000 (inclusive).
(You cannot use global variables for this assignment.)
Formulas to find monthly payment:
You need to convert rate and term to months because we are calculating monthly payment.
rate = rate / 1200.0; # you can enter the rate like 4.5 for 4.5%
term = term * 12; # you can enter the year like 30, or 15
monthlyPayment = principal * rate / ( 1.0 (rate + 1)**(-term))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
