# Program to calculate the payments on an auto loan

message='''
A = Monthly Payment
P = Principal
r = int rate per month
n = number of months


Problem
=========
P = 15090
Term = 4 years = 48 months
Int rate = 7%/year

Expect 361.07
'''

principal = input("Enter the principal for the loan ")
principal = float(principal)

loanTermYears = input("Enter the number of years for the loan ")
loanTermYears = float(loanTermYears)

interestRatePerYear = input("Enter the annual interest rate for the loan ")
interestRatePerYear = float(interestRatePerYear)/100

#print(principal,loanTermYears,interestRatePerYear)

loanTermMonthly = loanTermYears * 12

interestRateMonthly = interestRatePerYear / 12

#print(loanTermMonthly,interestRateMonthly)

monthlyPayment = principal * (interestRateMonthly*(1+interestRateMonthly)**loanTermMonthly)/((1+interestRateMonthly)**loanTermMonthly - 1)

print("Monthly Payment = ",monthlyPayment)

