I'm so very lost with this formula that is to be used in a function I have to write. I have to write a function that calculates a number, forgive my slowness but the formula just seems confusing. The function has 4 variables passed to it, from there I need to use the formula to calculate the number, which I then use in another function.
int CalculateRabbits (int numRabbits, int numFoxes, float birthrate,
float interaction)
PRn = PR(n-1) + BR * PR(n-1) - I * PR(n-1)
PRn is the new rabbit population after time period n
PR(n-1) is the beginning rabbit population at the time period n-1
BR is the birth rate for rabbits
PF is fox population, but for the function I'll be using that value will be 0 (rabbit only)
this function gets called in another function that simulates the population growth of rabbits as each year goes by (years is input by the user).
I'd greatly appreciate any help, I'm not looking for the actual code, just help understanding how to go about coding that formula, the time period part is throwing me off, as I'm under the impression the amount of years that will be simulated has nothing to do with this function, but instead the one that will be used after this one.