#Tyler Woodhull
#Payments.py
#7/16/13

value = int(input("What is the original value of the car you are buying? \n"))
rate = float(input("What is the interest rate of the loan, in percent? \n"))
payment = float(input("What is the monthly payment? \n"))

rate /= 100 #Turn our rate into a percentage
rate /= 12  #Divide by 12 in order to get the monthly interest

print("Month\tPayment\tAmount Owed")
month = 0

while value > 0: #If we still have money to pay, continue looping
    month += 1
    
    if (value * (1+rate) - value) >= payment: #If the price gap between our new value and original value
        print("YOU PAY TOO MUCH!")            #is too large, then we will never pay it off
        break
    
    value *= (1+rate) #value = value * (1 + rate)
    
    if value >= payment: #If the value is larger than or equal to our payment, let's pay it
        value -= payment
    else: #If the value is less than the payment, then we want to only pay how much is left
        payment = value
        value = 0
        
    print(month,"\t",payment,"\t",value,sep="")