Advertisement
maincarry

CS-A1-Worksheet3

May 15th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. '''
  2. Part 3: Loan
  3.  
  4. By Mark Wu 3217
  5. '''
  6. import WorkSheet, WorkSheet2
  7.  
  8. total_amount = float(input("Enter loan amount: "))
  9. annual_ir = float(input("Enter annual interest rate (percent): "))
  10. duration = int(input("Enter loan duration in years: "))
  11.  
  12. monthly_payment = WorkSheet.calculateMonthlyPayment(total_amount, annual_ir, duration)
  13.  
  14. print('LOAN AMOUNT: {} INTEREST RATE(PERCENT): {}'.format(int(total_amount), int(annual_ir)))
  15. print('DURATION(YEARS): {} MONTHLY PAYMENT: {}'.format(int(duration), int(monthly_payment)))
  16.  
  17. for index in range(duration):
  18.     year = index + 1
  19.     remain_balance = WorkSheet2.calculateRemainingLoanBalance(total_amount, annual_ir, duration, year * 12)
  20.     print('YEAR: {} BALANCE: {} TOTAl PAYMENT: {}'.format(year, int(remain_balance), int(monthly_payment * year * 12)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement