Qbasic

Moderators: None (Apply to moderate this forum)
Number of threads: 82
Number of posts: 236

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
HELP! Qbasic writers block. Posted by Default_User on 7 Dec 2009 at 12:54 AM
Hello, I am currently tutoring a student in a begining computer science class. Before the student turns it in i like to walk them through step by step. I am trying to figure out how to do this program this time around, and I am stumped.

I am to find (from a seperate .txt file) the Area's higher then 10,000 and save the county that is included in that in an array, but every time my code prints out 200 lines of the same thing, then moves to the next area..can I please have some assistance!?

I have included the code i have come up with so far, and the .txt file...please help!

DIM state as string
DIM county as string
DIM population
DIM area
DIM largecounty(1 TO 200) as string
DIM count
DIM n

OPEN "2000Census.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
INPUT #1, state, county, population, area
IF area > 10000 THEN
FOR n = 1 TO 200
LET largecounty(n) = county
print largecounty(n)
NEXT
LET Count = Count + 1
Print count
END IF
LOOP
CLOSE #1

Thank you!

Gowan
Report
Re: HELP! Qbasic writers block. Posted by applepig on 3 Jan 2010 at 12:31 AM
coooool !
[url= http://www.unmbtshoes.com]mbt shoe[/url]
<a href=" http://www.unmbtshoes.com">mbt shoe</a>

Report
Re: HELP! Qbasic writers block. Posted by PhilOfPerth on 21 Jan 2010 at 9:06 PM

: Gowan

Hi Gowan. I'm new to this forum (but not to BASIC programming), and I'm not sure how to use the site yet. You may have already been given the advice you needed, or moved on from the problem.
Anyway,I have written a short QB file that does what you wanted. Even if you don't need it, I enjoyed the exercise of writing it. I'll attach it as a Zip file (I hope), as the forum doesn't like the data file I wrote to go with it.


Attachment: COUNTY.zip (642 Bytes | downloaded 76 times)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.