about | help | code help+videos | done | prefs |
growth2
Write a function growth2(totalDays) that simulates a population that grows by 3 individuals each day but also shrinks by, on average, one individual every 2 days. Return the final population after that number of days. You must use a for loop to complete this computation. Don't just plug the input into a mathematical formula. growth2(10) → 25.0 growth2(1) → 2.5 growth2(2) → 5.0 ...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