Qbasicnews.com

Full Version: Year population
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im doing a program that gets the amount of years after 2003 to output the year and population beside or after it. The population in 2003 is 350000 and it increases 5% every year.

Can you help?
Thanx
Just some simple maths...

Code:
INPUT "Year you want to know the population of ",Year%

Population! = INT(350000 + 1.05 ^ (Year%-2003))

PRINT "Population in";Year%;"is";Population!
Double check that math.

If the population in 2003 = 350,000 and increases 5% each year, then you need to multiply, not add:

Code:
input "Enter year you wish to estimate population: ", year
population = 350000 * 1.05 ^ (year - 2003)
print "Population will be: "+ STR$(population)

*peace*

Meg.
I think the formula goes:

f(x) = c*e^(kt)

where e is log(1), c is the initial population, k is .05 and t is the number of years. some dumb algebra 2 formula i keep forgetting... i think the way they give might work too, i dont know (i was never much of a mathematician).
Woops my mistake :wink:
That's just the compound interest formula... nothing hard about it (but toonski your method is just weird and confusing)
yeah, it's used for interest problems, but my calc book uses it mostly for population problems, and pretty much any kind of exponential problem.
Toonski, e?
Depends on if it is a continual growth or not.