Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: Dr_Suess on May 03, 2003, 03:23:55 PM



Title: Year Population - repeat
Post by: Dr_Suess on May 03, 2003, 03:23:55 PM
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


Title: Year Population - repeat
Post by: Hard Rock on May 03, 2003, 04:01:26 PM
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.


Title: Year Population - repeat
Post by: Dr_Suess on May 03, 2003, 08:08:25 PM
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.


Title: Year Population - repeat
Post by: whitetiger0990 on May 03, 2003, 09:37:00 PM
Wat would the pop of yr 1 b


Title: Year Population - repeat
Post by: wizardlife on May 03, 2003, 10:53:38 PM
Quote from: "Dr_Suess"
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$$. (http://www.rage3d.com/board/images/smilies/biggrin.gif)


Title: Year Population - repeat
Post by: toonski84 on May 03, 2003, 11:25:14 PM
...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.


Title: Year Population - repeat
Post by: Hard Rock on May 04, 2003, 02:07:32 PM
:)

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


Title: Thanx alot
Post by: Dr_Suess on May 09, 2003, 02:16:04 PM
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