#sample solution
def hotelCost(days):
return 140*days
bill = hotelCost(5)
def getMin(balance, rate):
minimumPayment = rate * balance
return minimumPayment
print getMin(bill, 0.02)
def addMonthlyInterest(balance):
#since APR is an annual percentage, divide it by 12 to get the
#monthly percentage
APR = 0.15 / 12
interest = balance * APR
return balance + interest
print addMonthlyInterest(100)
print addMonthlyInterest(bill)
No comments:
Post a Comment