#Akshat shah
#Project 1

import sys

#This are the variables
p = float(input("Input a loan amount:"))
r = float(input("Input a interest rate:"))
n = float(input("Input duration of loan:"))

#Formula to compute the monthly payments, ** is used as an exponentional power
m = (p*r/1200.0) /(1-(1.0 + r / 1200.0)**(-12*n))

#This if statements are assigned to display the error message and let the users
#know that the variable cannot be less than zero.

#For principal
if p < 0:
    print("This field cannot be less than 0")
    sys.exit()


#For Interest rate
if r < 0:
    print("This field cannot be less than 0")
    sys.exit()

#For duration of loan
if n < 0:
    print("This field cannot be less than 0")
    sys.exit()

#The print command helps to display the final amount
#The round command helps to short the answer and the 2 describes
#how many decimal place I want my answer to round to.