Mortgage Calculator

#import Modules: from UserInputs import get_amount from UserInputs import get_interest_rate from UserInputs import get_down_payment from UserInputs import get_term from UserInputs import get_blank_line from MonthlyPaymentCalculator import calc_monthly_payment from GenerateJSON import generate_json import math import json # Get commandline input for 'Loan Amount' amount = get_amount() # Get commandline input for 'Interest Rate' interest_rate = get_interest_rate() # Get commandline input for 'Down Payment' downpayment = get_down_payment() # Get commandline input for 'Term' term = get_term() # Get commandline input for 'blankline' blank_line = get_blank_line() # calculate Principal principal = amount - downpayment # call Monthly payment calculator monthly_payment = calc_monthly_payment(principal,interest_rate, term) #calculate total amount total_payment = monthly_payment*term*12 # calculate Interest total_interest = total_payment - principal print("Printing output as json message...") print("") #output to JSON generate_json(monthly_payment, total_interest,total_payment)
Main code. This code calls other functions to achieve results

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.