Qbasicnews.com
July 18, 2019, 08:30:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Year Population - repeat  (Read 2410 times)
Dr_Suess
New Member

Posts: 9


« 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
Logged

A lie told often enough, becomes the truth"
Hard Rock
I hold this place together
*****
Posts: 775


WWW
« Reply #1 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.
Logged

b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Dr_Suess
New Member

Posts: 9


« Reply #2 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.
Logged

A lie told often enough, becomes the truth"
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #3 on: May 03, 2003, 09:37:00 PM »

Wat would the pop of yr 1 b
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #4 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$$.
Logged

toonski84
__/--\__
*****
Posts: 2567



« Reply #5 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.
Logged

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
Hard Rock
I hold this place together
*****
Posts: 775


WWW
« Reply #6 on: May 04, 2003, 02:07:32 PM »

Smiley

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

b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Dr_Suess
New Member

Posts: 9


« Reply #7 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
Logged

A lie told often enough, becomes the truth"
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!