Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

QBASIC


  • Please log in to reply

#1
banetistic

banetistic

    Member

  • Member
  • PipPip
  • 23 posts
I know QBASIC is old and is suppose to be easy, but this is my first programming class. And I'm not understanding the materials.

Here's the homework assignment:

Table 3.7 gives the distribution of the U.S. population (in thousands) by age group and sex. Write a program to produce the table that is partially shown in Figure 3.10. For each age group, the column labeled %Males gives the percentage of the people in that age group that are male, and similarly for the column labeled %Females. The last column gives the percentage of the total population in each age group. (Note: Store the information in Table 3.8 in DATA statements. For instance, the first row should be stored as DATA Under 20, 39168, 37202).

Table 3.7
-------------------------------------------------------------
Age Group / Males / Females
Under 20 / 39,168.00 / 37,202.00
20 - 64 / 76,761.00 / 78,291.00
Over 64 / 13,881.00 / 19,980.00
-------------------------------------------------------------

Table 3.10
------------------------------------------------------------------------------------------
U.S. Population (in thousands)

Age Group / Males / Females / %Males / %Females / %Total
Under 20 / 39,168.00 / 37,202.00 / 51.3% / 48.7% / 28.8%
20 - 64 / 76,761.00 / 78,291.00
Over 64 / 13,881.00 / 19,980.00
------------------------------------------------------------------------------------------

I have to write a program, do a flowchart, input/output, use subroutines. And was told that the program would use a RESTORE statement.

I know you guys can just put the answer together really easily. But I rather someone explain to me how to do it so I can try to figure it out myself. Otherwise I will never learn. Thanks in advance!

-Chris
  • 0

Advertisements


#2
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
wow.....i haven't touched qbasic in a while...and the class that i had on it in highschool....well...let's just say..the hardest proram we had to write was a firetruck siren...nevertheless...i will try to help you do some research...bear with me....for a-googling i shall go
  • 0

#3
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
wow...that was fast http://www.qbasic.com/qbindex.shtml this place has an actual qbasic chatroom
  • 0

#4
banetistic

banetistic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
I was kind of hoping for someone to guide me through this specific assignment, so I know how to do it. I've already googled all things related to QBASIC and there's not much out there. I've been to the website you mentioned just thought someone here would know the answer as well since I think that site isn't updated. I'll probably post it on that site too see if it helps. Thanks :tazz:
  • 0

#5
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
yeah....i understand....just trying to put in what meager help i can...
  • 0

#6
lilhawk2892

lilhawk2892

    Member

  • Member
  • PipPipPip
  • 128 posts
well for the expert that replyed here how long would it take me to learn qbasic cause next year i expect to do something like that in school and i dont like to be the person there who cant do anything because it confused me
  • 0

#7
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
qbasic is easy to learn once you have the books and stuff...it's not a complex language...i just haven't used it in 7 years....or seen it...it's pretty fun stuff mainly because of it's limitations..ou can't get into too much difficult stuff with it so it makes it a little easier...
  • 0

#8
banetistic

banetistic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
No one wants to help me? Not asking for you to do it for me, just help me with it so I can understand and do it myself. I need to have the flowchart done by Monday, and the program done the following week. I know the flowchart should be something like, start, input, output, end. Something to that effect right? I just don't know where everything goes or even what to put down.
  • 0

#9
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
banetistic,

we don't do homework on this site. we can, however, answer specific questions regarding a snippet of code. I'd have to check with a moderator as to how much we can actually do on this forum.

here's something to get you started on your flowchart. you will have to supply blocks and symbols, and any additional steps.

start
get data - # of males
get data - # of females
sum # of males + # of females
calculate % of males
calculate % of females
display results
done

you may want to review the red text below

Age Group / Males / Females / %Males / %Females / %Total
Under 20 / 39,168.00 / 37,202.00 / 51.3% / 48.7% / 28.8%


bdlt
  • 0

#10
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Ah, now I understand what was being meant by "flowsheet". I thought this was referring to some sort of graphic output! :tazz:

I am also waiting for the moderator answer on helping with programming assignments. I don't want to step on any toes or violate any TOS's.

The flowsheet provided is a great starting place and goes through all the major steps of the program.

For a pretty decent quick overview of Qbasic (for us answering questions and not using Qbasic for some time), here is a link to a nice text document reviewing pretty much all of the main functions, including DATA, READ, RESTORE, SUB, etc. The link is:
http://tedfelix.com/qbasic/. For a decent (as far as I can tell) open-source BASIC compiler, check out:
http://www.freebasic.net/

For writing your QBASIC code, I highly recommend the free text editor called "Crimson Editor". It features syntax highlighting, which means it will change the color of words depending on if they are key words in the language - VERY helpful! Just save your programming files as "*.bas". You can download it at: http://www.crimsoneditor.com/

I whipped up a working version of this program, so if you want to ask any specific coding questions, go ahead and I will answer the best I can.

Cheers,
Tom

banetistic,

we don't do homework on this site. we can, however, answer specific questions regarding a snippet of code. I'd have to check with a moderator as to how much we can actually do on this forum.

here's something to get you started on your flowchart. you will have to supply blocks and symbols, and any additional steps.

start
get data - # of males
get data - # of females
sum # of males + # of females
calculate % of males
calculate % of females
display results
done

you may want to review the red text below
bdlt

View Post


Edited by gust0208, 25 September 2005 - 01:32 AM.

  • 0

Advertisements


#11
admin

admin

    Founder Geek

  • Community Leader
  • 24,639 posts
As a general rule we do not provide answers to specific homework questions. We can help if you have trouble understanding a concept, or get stuck on a project you're working on that's not a homework assignment.
  • 0

#12
lilhawk2892

lilhawk2892

    Member

  • Member
  • PipPipPip
  • 128 posts
wut if someone just says its a project but its really homework
  • 0

#13
admin

admin

    Founder Geek

  • Community Leader
  • 24,639 posts
We have better things to do than ask 20 questions. It's usually pretty obvious when it's a homework problem.
  • 0

#14
banetistic

banetistic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
Sorry, I should be more clear. Yes, this is a homework assignment and yes I do need help with it, but I never said I wanted someone to just give me the answers whether it was against the rules or not. I am having a hard time understanding the concept therefore not even able to write the program and post it here to see what kind of mistakes I made. I'm still trying to turn words into codes. It's like doing word problems in math class. It's one of my big weaknesses. And since there is no CS tutor at my school, I was hoping someone here would tutor me and this assignment would be a good starting point. Hope I made it more clear, thanks.
  • 0

#15
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
did the flowchart info make sense?

this is good advice from gust0208. there is sample code in chapter 25.9!

For a pretty decent quick overview of Qbasic (for us answering questions and not using Qbasic for some time), here is a link to a nice text document reviewing pretty much all of the main functions, including DATA, READ, RESTORE, SUB, etc. The link is:
http://tedfelix.com/qbasic/.


you might set aside an hour or 2 each day and spend time reading the tutorial in the link above.

a couple of hints:
for get data in the flowchart use DATA and READ in the code
for display results in the flowchart use PRINT in the code
for calculate read chapter 7 NUMBERS

before you start any programs you might want to read chapters 2 through 7, then go through chapter 1

note - you will need to add this line near the top of the code in order for the sample code in ch 25.9 to run.

DIM A(10)

Edited by bdlt, 26 September 2005 - 02:29 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP