Help for Air Lines Reservition System

Reply

Join Date: Apr 2006
Posts: 2
Reputation: qamar2006 is an unknown quantity at this point 
Solved Threads: 0
qamar2006 qamar2006 is offline Offline
Newbie Poster

Help for Air Lines Reservition System

 
0
  #1
Apr 30th, 2006
Hi all members.. how are you

Can any one help me to make a C programming project ?

Its an "Air Lines Reservition System"

The project is for our C-programming semester in the university
and its due to 15 - 4 - 2006 . The requirements is as follow:

This C-based program is supposed to computerize all or nearly all daily operations required by any Air Lines Company to accomplish the process of booking and managing its flights and flight-related issues.
In order to accomplish this task, you should follow all requirements and specifications listed below, and the suggested methods (e.g.Menus, Programming structures …) listed to guide you during this duty.
If you don’t follow these methods you must insure that your own methods are fulfilling all the requirements and specifications of the system.
The Main Menu of the system should be as follow:

I. Access Routes’ Information.
II. Access Flights’ Information.
III. Generate Flight-related reports.
IV. Book new flight tickets.




Menu Option I:
There are 3 operations included in Menu option I as follow:
�� Add new Route to the system.
�� Delete an existing Route (Should be done by Route No.).
�� Show all Routes in your system (you are free to display them even on screen or in file).
− We mean by Route, the flights lines between cities or countries
(E.g. Gaza - Amman, Gaza – Cairo …).
− The Route’s Information should be stored for each new one are:
Route_No, Route_Name, and Route_Price.
You should use a structure named ROUTE to hold this
Information.
− All routes of your system should be saved in a binary file
named ROUTES.bin.
-----------------------------------------------------

Menu Option II:
There are 3 operations included in Menu option IIas follow:
�� Add new flight to a specific Route (this should be done by entering the Route No. first).
�� Delete an existing flight from a specific Route (should be done
by Flight No.).
�� Show all flights in a specific Route (by Route No.).
− The Flight’s Information should be stored for each new one are:
Route_No, Flight_No, Flight_Date, Flight_Time and
Seats_Available.
− Any Route could has more than one Flight.
− No Flight belongs to more than one Route.
You should use a structure named FLIGHT to hold this Information.
Seats_Available must be 50 for each new flight, and you mustn’t book new tickets on a flight with no Seats_Available!?
Flight_Date should be of a structure type named DATE with the following attributes: D_Year, D_Month and D_Day.
− All flights of your system should be saved in a binary file
named FLIGHTS.bin.
--------------------------------------------------

Menu Option III:
There are 3 operations included in Menu option III as follow:
�� List all passengers of a specific flight. (Should be done by
Flight_No).
�� Delete all passengers those didn’t paid there tickets. (Should be
done by Flight_No also).
�� Query about a flight price, date and time. (Should be done by
Flight_No).
When you perform the first operation you must list paid
passengers only in a good formatted text file named report.txt
for printing purposes.

− You must list in that file all passengers’ and flight’s information
as explained in the next Menu Option.

--------------------------------------------------

Menu Option IV:
− There is only one operation included in this option which is the
booking operation but it’s the most important and you should
follow the directions listed below:
− Any passenger can’t book on more than one flight a time.
− You should first insure that the desired flight has seats
available for that new passenger(s) (you should perform that
checking by entering the desired Flight No. first and you must
save this flight No to store it with the passenger’s Info.).
− If the desired flight already has seats available you can proceed
with the booking operation, else this flight will be a full booked and you must change that flight.
− The Passenger’s Information should be stored for each new one
are:
Flight_No, P_No, P_ID, P_Fname, P_Lname, P_Age and P_Paid.
The P_No should be a combination of Flight_No he booked on
and serial number indicating his/her seat number in the
plane!?
The P_Paid should be of Boolean data type that you should
define first, and it must hold a True (1) value when that
passenger already paid his ticket, a False (0) value otherwise.
You should use a structure named PASSENGER to hold this
Information.
− You should use an array of structures to add the new
passengers in a specific flight to it first, then saving the whole
array in a binary file named PASSENGER.bin each time.


General Notes:
- Follow the directions listed above for each operation as can as
possible.
- Sub menus for each operation (if there is any), should appear
separately and when the user exits from it, the system should return
to the main menu not exiting the system. (The format of these menus
is up to you).
- You should implement each operation of this system in means of
functions.
- You must handle all files’ operations errors.
- You must separate your code in three files:
I. A header file to hold all structures and functions’ prototypes
should be named project.h.
II. A source file to hold all functions’ definitions should be named
source.c.
III. An interface file to hold the main function only should be
named project.c.
- You should write a comment for each file and function as follow:
The Files:
/*
File name: xxxxxxxxxxxxxxxxxxxxx.c/h
Create by: your name - your ID
Create date: dd/mm/yy
Update date: dd/mm/yy
Description: a paragraph to say the purpose of this file
Functions: list of the functions declared/defined within the file
f(), ff(), …… */
The Functions:
In Header File:
/* myFun prototype
Argument 1: a char represent X
Argument 2: an int represent Y
Argument i: ********************
Return : an int represent */
int myFun(char, int);

Please, help me for this project, Its so important
this is my email: <<email snipped>> if any one can help me

Thanks for all
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,361
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 241
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Help for Air Lines Reservition System

 
0
  #2
Apr 30th, 2006
You may have missed this announcement.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Help for Air Lines Reservition System

 
0
  #3
Apr 30th, 2006
Hullo which part are you stuck on?
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Help for Air Lines Reservition System

 
0
  #4
Apr 30th, 2006
> and its due to 15 - 4 - 2006
Seems that's not the only thing which has been missed....
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 2
Reputation: qamar2006 is an unknown quantity at this point 
Solved Threads: 0
qamar2006 qamar2006 is offline Offline
Newbie Poster

Re: Help for Air Lines Reservition System

 
0
  #5
Apr 30th, 2006
Originally Posted by Salem
> and its due to 15 - 4 - 2006
Seems that's not the only thing which has been missed....
LOL !!!! OOps Sorrrry its 15 - 5-2006 :cheesy:



Originally Posted by Dave Sinkula
>You may have missed this announcement.
Originally Posted by iamthwee
>Hullo which part are you stuck on?
Its first time i entered the forum and i hope i still a friend here because i like programming (but iam begainner) and want to practice programming with outhers but iam nowadays want to make the project before time over .

So, i will attach my (Add_Delete_Routes.C file) to be sure that iam trying to solve this problem.

NOW ( Can any one tell me what is the error in my code? it display numbers in file as unknown symbols.)

OR (Can any one help me in writting the Menu Option IV ) because i didnt understand how to make it (at least help me with steps)
Attached Files
File Type: c Add_Delete_Route.c (1.5 KB, 8 views)
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,361
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 241
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Help for Air Lines Reservition System

 
0
  #6
Apr 30th, 2006
Since it's smallish, it may be better simply to post the code (using code tags: [code][/code]).
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. struct ROUTE
  5. {
  6. int rout_no;
  7. char rout_name [20];
  8. int rout_price ;
  9. }routen;
  10.  
  11. void add_rout(void)
  12. {
  13. FILE *fptr;
  14. char temp[30];
  15.  
  16. int a=35;
  17.  
  18. fptr=fopen("c:\\airline.bin","a");
  19.  
  20. printf("ENTER NEW ROUT \n");
  21. printf("\nENTER THE NAME OF THE ROUT :");
  22. gets(temp);
  23.  
  24. strcpy(routen.rout_name,strupr(temp));
  25.  
  26. printf("\nENTER THE NUMBER OF THE ROUT :");
  27. scanf("%d",&routen.rout_no);
  28.  
  29. printf("\nENTER THE PRIVE OF THE ROUT :");
  30. scanf("%d",&routen.rout_price);
  31.  
  32. fwrite(&routen, sizeof(routen),1, fptr);
  33.  
  34. printf("\n*****RECORD ADDED*****");
  35. printf("\n PRESS ANY KEY TO CONTINUE ");
  36.  
  37. // getch();
  38.  
  39. fclose(fptr);
  40. fflush(stdin);
  41.  
  42. void delete_rout(void)
  43. {
  44. FILE *fptr;
  45.  
  46. int i;
  47.  
  48. printf(" DELETE AN EXISTING ROUT \n");
  49.  
  50. printf(" ENTER THE NO OF THE ROUT TO DELETE :");
  51. scanf(%d",&i);
  52. fptr=fopen("c:\\airline.txt","r");
  53.  
  54. fseek(fptr,(i-1)*sizeof(struct ROUTE),SEEK_SET);
  55. fread(routen,sizeof(struct ROUTE),1,fptr);
  56.  
  57. if(routen.rout_no==0){
  58.  
  59. printf("ROUT %d DOES NOT EXIST.\n",i);
  60. }
  61. else{
  62. fseek(fptr,(i-1)*sizeof(struct ROUTE),SEEK_SET);
  63. fwrite(&d_rou,sizeof(struct ROUTE),1,fptr);
  64.  
  65. printf("*****THE ROUT WAS DELETING ****\n");
  66. }
  67. }
  68.  
  69. void main(){
  70.  
  71. add_rout();
  72. delete_rout();
  73. }
  74.  
I also gave it a quick pass through a beautifier, which will help point out a syntax error. But know that good indentation is to help beginners find bugs. Old timers use tools.

It looks as though you are suffering the trifecta of what not to do when starting out:
  • gets(temp);
  • fflush(stdin);
  • void main()
This is not a good sign.

Here are some FAQs to help bail you out. It is fairly important to know how to do some of these "Week 1" type things before moving on.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC