about | help | code help+videos | done | prefs |
growth4
Write a function growth4(totalDays) that simulates a population that grows by 2 on the first day, 4 on the second day, 8 on the third day, 16 on the fourth day, etc. Assume that the initial population size is 10. Return the total population size on the last day. Use a for loop. growth4(10) → 2056 growth4(1) → 12 growth4(2) → 16 ...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