Skip to content

Commit 1acfd43

Browse files
authored
Create monthly_payment
1 parent 18e41e7 commit 1acfd43

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

monthly_payment

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# A bank is charging 6% interest per year for a loan. Monthly payments will be made for a certain period of time. Calculate the monthly payment amount a person needs to pay by
2+
asking the user to enter the loan amount and time period.
3+
4+
5+
6+
interestRate = 1.06
7+
8+
initialLoan = input('Enter initial loan: RM')
9+
initialLoan = int(initialLoan)
10+
timePeriod = input('Enter time period (in months):')
11+
timePeriod = int(timePeriod)
12+
print(' ')
13+
14+
print('Interest rate: 6%')
15+
monthlyPayment = initialLoan*interestRate/timePeriod
16+
print('Monthly payment =', monthlyPayment)
17+
print(' ')
18+
19+
input('Press ENTER to exit')

0 commit comments

Comments
 (0)