You are on page 1of 1

Paloma, Rona Jean R.

BSIT -1B

1. Write a program that will compute for the hypotenuse of a triangle.


Sample output:
a: 8
b: 4
c: ?
Answer:
A = int (input(“a:”))
B = int (input(“b:”))
print (“a:”, A)
print (“b:”, B)
C = (A ** 2 + B ** 2) **0.5
Print (“c:”, C)

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)

You might also like