From 78c7031ecdc670c61b40de909e122f7075a9189b Mon Sep 17 00:00:00 2001 From: jbarill Date: Wed, 14 Oct 2015 22:51:44 -0700 Subject: [PATCH] Update Module4MortgageCalculatorChallengeSolution.py --- Solutions/Module4MortgageCalculatorChallengeSolution.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Solutions/Module4MortgageCalculatorChallengeSolution.py b/Solutions/Module4MortgageCalculatorChallengeSolution.py index ddb9c28..7fc3af0 100644 --- a/Solutions/Module4MortgageCalculatorChallengeSolution.py +++ b/Solutions/Module4MortgageCalculatorChallengeSolution.py @@ -3,7 +3,7 @@ monthlyPayment = 0 loanAmount = 0 interestRate = 0 -numberOfPayments = 0 +NofPayments = 0 loanDurationInYears = 0 #Ask the user for the values needed to calculate the monthly payments @@ -17,11 +17,11 @@ interestRate = float(strInterestRate) #Since payments are once per month, number of payments is number of years for the loan * 12 -numberOfPayments = loanDurationInYears*12 +NofPayments = loanDurationInYears*12 #Calculate the monthly payment based on the formula -monthlyPayment = loanAmount * interestRate * (1+ interestRate) * numberOfPayments \ - / ((1 + interestRate) * numberOfPayments -1) +monthlyPayment = loanAmount * interestRate * (1+ interestRate) * NofPayments \ + / ((1 + interestRate) * NofPayments -1) #provide the result to the user print("Your monthly payment will be " + str(monthlyPayment))