Question: C++ The assignment this week is to develop a recursive algorithm to determine how many generations it will take before a population reaches a certain
C++ The assignment this week is to develop a recursive algorithm to determine how many generations it will take before a population reaches a certain size. I have provided you with a function uint updatePopulation(uint n) that takes a population number and returns the next step in that population growth. The algorithm I'm using for this problem is very straight forward current population - average deaths + average births. In reality the update population function would grow to become much more complicated, could have any number of contributing factors involving population size, existing land etc, etc BUT notice the underlying algorithm for calculating population over multiple generations would remain the same if written correctly to depend on the updatePopulation function. You assignment is to fill in the function howManyGenerations(uint start, uint final) that RECURSIVELY determines how many generations it will take to reach the final value given the start value.
#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
