Question: 1. Please use Python 3 to write the follwing functions: Please do not write by hand show all outputs and please share code. 2. Please
1. Please use Python 3 to write the follwing functions: Please do not write by hand show all outputs and please share code.
2. Please show all outputs.
PLEASE JUST ANSWER #3 BASED ON THE INFORMATION GIVEN BELOW:
problem 3
Rewrite your code from the mortgage calculator from the Python part of Assignment 2 to use functions.
You must use (and call, ha) at least three functions total.
INFROMATION TO ANSWER PART #3 show outputs and please share code
- Mortgage calculator simply stores only necessary information such as the principal amount as balance, monthly_interest. the number of months, interest (of that month) for each month as iteration. In each iteration, we simply update the values of the variables such as balance, month, etc.
- Steps involving in mortgage calculator: (See code for more details)
Step 1: Storing of variables (Such as balance, month, etc.)
Step 2: Iteration loop (Including update information of amount, interest, and months)
Step 3: Printing values in required format i.e.in form of a table.
Python 3 Code: (Runnable and tested on python3.7)
# Python 3 program for mortgage calculator
import sys
import os
balance = 100000
interest_rate = 5.0
monthly_payment = 500
print("month" + "\t" + "payment" + "\t" + "interest" + "\t" + "balance" + " ")
M_value = 99000
month = 0
interest = 0
while(balance > M_value):
interest = balance * (interest_rate / 12)
month += 1
balance = balance + interest - monthly_payment
print(month + "\t" + monthly_payment + "\t" + interest + "\t" + balance + " "
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
