SHARE
TWEET

CS-A1-Worksheet3

maincarry May 15th, 2016 21 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top