# Figure out interest rate if compounded monthly

month = 1   # integer; sentry variable
debt = 100.0 # floating point; value of debt
rate = 5.0   # floating point; annual interest rate
monthlyRate = rate/12  # floating point; rate for a month
print("annual rate",rate,"and monthly rate",monthlyRate)

while month <= 12:
    print("Month is",month)
    interest = debt*(monthlyRate/100)
    # floating point; interest paid this month
    debt = debt + interest
    print("interest",interest,"and debt",debt)
    month = month+1 # update sentry variable

# Let's make a nice-looking final message for
# the user.  
totalInterest = debt-100.0 # f.p.; all the interest
prettyOutput = "{:.2f}".format(totalInterest)
# string; the total interest with two decimal places
print("Total interest paid is $"+prettyOutput)


