HELP! Qbasic writers block. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

HELP! Qbasic writers block.

Default_UserDefault_User Posts: 1Member
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

Comments

Sign In or Register to comment.