Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Year population
#1
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
A lie told often enough, becomes the truth"
Reply
#2
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!
crapyard / Smile Cheerful Software
[Image: Cheerful.gif]


"All your base are belong to us"
Reply
#3
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.
Reply
#4
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).
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#5
Woops my mistake :wink:
crapyard / Smile Cheerful Software
[Image: Cheerful.gif]


"All your base are belong to us"
Reply
#6
That's just the compound interest formula... nothing hard about it (but toonski your method is just weird and confusing)
Reply
#7
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.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#8
Toonski, e?
Depends on if it is a continual growth or not.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)