I am writing a simple program that uses functions found in different .cpp files. All of my prototypes are contained in a header file. I pass some of the functions into other fun
Modify your estimated population function to take a growth argument of type float. Then you can call the growthRate function with your birthRate and deathRate and use the return value as the input for grown into estimatedPopulation.
float growthRate (float birthRate, float deathRate)
{
return ((birthRate) - (deathRate));
}
int estimatedPopulation (int currentPopulation, float growth)
{
return ((currentPopulation) + (currentPopulation) * (growth / 100);
}
// main.cpp
int currentPopulation = 100;
int births = 50;
int deaths = 25;
int population = estimatedPopulation(currentPopulation, growthRate(births, deaths));