Respuesta :
Answer:
function currentPopulation = CalculatePopulation(numGeneration, initialPopulation)
i = 1;
currentPopulation = initialPopulation;
while(i <= numGeneration)
currentPopulation = 2* currentPopulation;
i= i+1;
end
end
Explanation:
- Assign 1 to i as an initial loop value .
- Assign initialPopulation to currentPopulation variable.
- Run the while loop until i is less than numGeneration.
- Inside the while loop, double the currentPopulation variable.
- Inside the while loop, Increment the i variable also.
In this exercise we have to use the knowledge of computational language in python to describe a code, like this:
The code can be found in the attached image.
To make it easier the code can be found below as:
function currentPopulation = CalculatePopulation(numGeneration, initialPopulation)
i = 1;
currentPopulation = initialPopulation;
while(i <= numGeneration)
currentPopulation = 2* currentPopulation;
i= i+1;
end
end
See more about python at brainly.com/question/26104476