Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 23rd, 2013  |  syntax: None  |  size: 1.01 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. print 'Given a starting balance and interest rate, this program will calculate your minimum monthly payment,'
  2. print 'in increments of $10, that will pay off your balance in 12 months or less.'
  3.  
  4. balance = float(raw_input('Enter the outstanding balance on your credit card:'))
  5. interestrate = float(raw_input('Enter the annual credit card interest rate as a decimal:'))
  6.  
  7. payment = 0
  8.  
  9. def twelvemonth ():
  10.     global payment
  11.     month = 0
  12.  
  13.     while month <=11:
  14.         month = month + 1
  15.         if month==1:
  16.             calcbalance = balance
  17.             payment = payment + 10
  18.         intowed = calcbalance*(interestrate/12)
  19.         calcbalance = calcbalance + intowed - payment
  20.         if calcbalance <= 0:
  21.             print 'Monthly payment to pay off debt in 1 year:  $' + str(round(payment, 2))
  22.             print 'Number of months needed:  ' + str(month)
  23.             print 'Balance:  $' + str(round(calcbalance, 2))
  24.             month = 12
  25.      
  26.     if calcbalance > 0:
  27.         twelvemonth ()
  28.  
  29. twelvemonth ()