Question: Question 3 - Recursive functions (15 pts] Rewrite getGrowth function from Question 1 in a recursive way but this time we don't need a list
![Question 3 - Recursive functions (15 pts] Rewrite getGrowth function from](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f534cda133a_86966f534cd054c0.jpg)
Question 3 - Recursive functions (15 pts] Rewrite getGrowth function from Question 1 in a recursive way but this time we don't need a list nor to return the result in a list. The function should return the estimated number of population for year n given year zero, rate, number of immigrants per year and the number of years. The signature of the function shall remain similar to the previous one: getGrowth Recursive(population_year_zero, rate, immigration_per_year, nbr_of_years) For example, if the population for year zero was 1000., the rate of growth is 2% (0.02), immigration per year is 10 and we want to know the population after 3 years, then the call for the function should be: growth_estimate = getGrowth(1000, 0.02, 10,3) Then if you print the result with print(growth_estimate ) you should get a result like this: 1091.812 which represents the population after 3 years
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
