File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 3
3
monthlyPayment = 0
4
4
loanAmount = 0
5
5
interestRate = 0
6
- numberOfPayments = 0
6
+ NofPayments = 0
7
7
loanDurationInYears = 0
8
8
9
9
#Ask the user for the values needed to calculate the monthly payments
17
17
interestRate = float (strInterestRate )
18
18
19
19
#Since payments are once per month, number of payments is number of years for the loan * 12
20
- numberOfPayments = loanDurationInYears * 12
20
+ NofPayments = loanDurationInYears * 12
21
21
22
22
#Calculate the monthly payment based on the formula
23
- monthlyPayment = loanAmount * interestRate * (1 + interestRate ) * numberOfPayments \
24
- / ((1 + interestRate ) * numberOfPayments - 1 )
23
+ monthlyPayment = loanAmount * interestRate * (1 + interestRate ) * NofPayments \
24
+ / ((1 + interestRate ) * NofPayments - 1 )
25
25
26
26
#provide the result to the user
27
27
print ("Your monthly payment will be " + str (monthlyPayment ))
You can’t perform that action at this time.
0 commit comments