id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs109fall2014 > annualInterestAmount
prev  |  next  |  chance

You have a bank account which begins with P dollars (P>0) and has a yearly interest rate of r, compounded monthly. Notice that we didn't say "r percent" here so you should assume 0<r<1. Write a function annualInterestAmount(P,r,y) which computes the amount of money you'll have after y years, then returns the integer part of this number. Note that because compounding is happening more frequently than once per year the APY is greater than the APR, so you don't just have P(1+r) at the end of the first year.


annualInterestAmount(1000, 0.03, 1) → 1030
annualInterestAmount(1000, 0.03, 2) → 1061
annualInterestAmount(1000, 0.03, 7) → 1233

...Save, Compile, Run (ctrl-enter)

def annualInterestAmount(P,r,y):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Post-solution available

Copyright Nick Parlante 2017 - privacy