about | help | code help+videos | done | prefs |
yearsUntilDoubled
Write a function yearsUntilDoubled(amount, rate) that returns the number of years until amount is doubled when it earns the given rate of interest, compounded annually. Use a while loop. Assume that rate is a number between 0 and 1 yearsUntilDoubled(1000, 0.03) → 24 yearsUntilDoubled(1000, 0.05) → 15 yearsUntilDoubled(500, 0.07) → 11 ...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