Qbasicnews.com
Year Population - repeat - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: Year Population - repeat (/thread-764.html)



Year Population - repeat - Dr_Suess - 05-03-2003

Hey, sorry maybe i wasnt specific enough in my last post....i wanted it to be in a for..next loop, and when it prints out the year it prints out all the years till the one u specify...

Ex: ...2005, would print out all the years populations up to 2005 in a nice chart form...

Thanx for your help...
bye


Year Population - repeat - Hard Rock - 05-04-2003

First off, were not here to do your homework..

second:

Code:
When posting a question, especially if its home work, you need to show that you have attempted it in some way. Either by showing some code that you have written or where your thoughts on the matter have stopped or got stuck.

Third off , its not hard, psuedo code, im sure you can port this

Code:
population = what you want
yearat = The year it stars off

for 0 to yeartogoto - (yearat +1)

'I added the + 1 becuase otherwise it would calculate it for year 2003
'Alternatively, you could just move the next statement after the print statement

population = population *1.05

PRINT "your popluation is  "; population
next

'Please note im intentionally not using fully compatible qb code so you still have some work to do
'And to get the current population you use the variable you are looping with + year at


And finally, instead of wriing a WHOLE NEW TOPIC, you can reply right?

Please, try it yourself first, THAN ask question.


Year Population - repeat - Dr_Suess - 05-04-2003

Look i did try it, and i didnt bother writing the code out...i asked for help, but not ur smart @$$ comments ok?

thanx for the help.


Year Population - repeat - whitetiger0990 - 05-04-2003

Wat would the pop of yr 1 b


Year Population - repeat - wizardlife - 05-04-2003

Quote:Look i did try it, and i didnt bother writing the code out...i asked for help, but not ur smart @$$ comments ok?

Better a smarta$$ than a dumba$$. [Image: biggrin.gif]


Year Population - repeat - toonski84 - 05-04-2003

...we're cussing in l33t now?

as for dr. suess, i'm going to have to side on hard rock on this one. after all, you asked for advice, you can take it or leave it.


Year Population - repeat - Hard Rock - 05-04-2003

Smile

And on a side note, it should be for 0 to yeartogoto - yearat, i edited the post so the it looks neater.


Thanx alot - Dr_Suess - 05-09-2003

Hey, thanx alot guys for your help, i finished the program....i had all that code b4, cept i was using a do...loop and not the for ...next....

Anyways, thanx alot and i appreciate it
bye