# Arup Guha
# 10/22/2020
# Example that calculates compounded interest - edited to do both
# compound and annual

import math

# Constant
MONTHS_PER_YEAR = 12

# Get relevant values.
principle = float(input("How much are you investing?\n"))
rate = float(input("What is the yearly rate of return?\n"))
time = int(input("How many years are you investing?\n"))

# Compound annually.
moneyAnnual = principle*math.pow(1+rate, time)

# Compound monthly.
moneyComp = principle*math.pow(1+rate/MONTHS_PER_YEAR, MONTHS_PER_YEAR*time)

# Output result.
print("Compounded annually, you will have $",moneyAnnual,".", sep="")
print("Compounded monthly, you will have $",moneyComp,".", sep="")
