about | help | code help+videos | done | prefs |
getNumberOfYears
There is a bank account that earns 5 percent interest per year. The initial account balance is $10000. Given a target balance (for example, $20000), return the number of years that it takes for the account balance to reach the target balance. The number of years should be an integer. (Difficulty level: 2) getNumberOfYears(12000) → 4 getNumberOfYears(15000) → 9 getNumberOfYears(20000) → 15 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy