Professional Documents
Culture Documents
BSIT -1B
2. Write a program that will compute for the monthly payment with a yearly
interest of 3%.
Sample output:
Amount: 10000
Interest Rate: 3%
Yearly interest : ? 300
Number of Years: 3
Total Interest: ?
Total loan: ?
Monthly payment: ?
Answer:
amount = int (input (“Amount: “))
interest = float (input(“Interest Rate: “))
nyears = int (input (“Number of Years: “))
print(“Amount: “, amount)
print (“Interest Rate: “, interest)
yinterest = int (amount * interest)
print (“Yearly Interest: “, yinterest)
print (“Number of Years: “, nyears)
totalInt = (yinterest * nyears)
print (“Total Interest: “, totalInt)
tloan = int (amount + totalInt)
print (“Total loan: “, tloan)
monthpay = float (tloan / (nyears * 12))
print (“Monthly payment: “, monthpay)