File handling and Case study....

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Karl
Newbie
Posts: 2
Joined: Mon Nov 26, 2007 4:28 am
Location: Argentina
Contact:

File handling and Case study....

Post by Karl »

Hi, gud day!!! I need help we have 2 weeks left. Can you help me??? We need to make case study in Qbasic. ANd I think my program is About the "AIRPORT BOOKING", I have some idea but I need to improve it. Our prof said that we must save the data in notepad. We use a file handling, you know about that??? Plz help me, thnks.............

-Karl
KAAAAAAAAAAARRLL
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

A homework then.

Explain better, try atleast something yourself, post code here and we will help you but we do not make your homeworks.
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: File handling and Case study....

Post by Mac »

Karl wrote:Our prof said that we must save the data in notepad
He/she probably meant to save the data in a file that NOTEPAD can OPEN, since there is no such concept as "save the data in notepad".

Here is a routine that creates a simple 2-line file that NOTEPAD can OPEN:

OPEN "MyStuff.txt" FOR OUTPUT AS #1
PRINT #1, "First line"
PRINT #1, "Last line"
CLOSE #1

If you look at that and hit yourself in the head, saying "I should have figured that out myself! How did I miss that!", then you are in good shape. Do as E.K.Virtanen said and make your best try. Ask specific questions such as "Why does this stop with this error message...", not general questions such as "What else do I have to do?".

If you have no idea what the OPEN/CLOSE stuff above means and how it fits into your assignment, just turn in a sheet to your professor saying "I have no idea how to write this program" and maybe you can get some person-to-person help.

Mac
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

I think he needs help using a DOS SHELL to open his file IN Notepad!

Your professor

PS: What do you mean by "I think my program is about AIRPORT BOOKING"? I sure could not tell you!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Karl
Newbie
Posts: 2
Joined: Mon Nov 26, 2007 4:28 am
Location: Argentina
Contact:

All who answer my post

Post by Karl »

You guys, I said help me. But some of you didn't help on my program. This is my layout: Airport Booking
-Menu-
1.)Inputting/Booking
2.)Searching
3.)Deleting/Cancelling the flight
4.)Exit

Sub Book
Enter name?
Enter address?
Enter Age?
Status:
Nationality:
Contact No:
Company:
Occupation:

Type
1.)VIP
2.)Tourist
3.)OFW
Are you a..(1-3)
Destination (press enter)
end sub

Sub typ
VIP=3000
Trst=2000
OFW=0
end sub

Sub Dest
-Menu-
1.)Asia 4.)South America
2.)Australia 5.)Europe
3.)North America 6.)Africa
choose (1-6)

Sub Asia
-Directory-
1.)Brunai
2.)Japan
3.)Malaysia
4.)Singapore
5.)Thailand
6.)Vietnam
7.)China
8.)indonesia
9.)marshall island
10.)guam

(Note: this will apply to other subroutines of continents)

Also we have a searching and deleting....

(You get my logic???)

Plz. Help me...........
KAAAAAAAAAAARRLL
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

That is NOT CODE! That is an outline of your freaking assignment! We don't write code for people that is homework and you seem like a smart ass anyhow!

Finally, out of the goodness of your heart, you give us your assignment! And you banter us for not writing it for you? Ooops, where did I put my crystal ball? Your not worth my time smarty pants!

Perhaps Mommy or Daddy can help.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
nkk_kan
Veteran
Posts: 57
Joined: Thu Jun 01, 2006 10:45 am
Location: Gujrat,India,Asia
Contact:

Post by nkk_kan »

well...assuming that u KNOW some qbasic commands..

u need some simple commands and loads of logic...
you'll find SELECT CASE command useful..
just print out the menu and get the number using INPUT command..
and print that in ur notepad file as shown by Mac..
and searching and deleting is harder and you cannot learn it in 2 weeks but atleast u can program it so that it prints the inputted data in notepad file..
hope i helped you..but u can't expect people to do your homework/assignment...they'll never write the whole program for you..that's what u r expecting i think...
and if you don't have any programming knowledge of qbasic..you should really try out Mac's idea..
Post Reply