473,386 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to write airline reservation system program in c.

10
A small airline has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats).
Your program should display the following menu of alternatives :

Please type 1 for "smoking"
Please type 2 for "non-smoking"

If the person types 1, your program should assign a seat in the smoking section(seats 1 - 5).If the person types 2, your program should assign a seat in the non-smoking section (seats 6 - 10). Your program should then display a boarding pass indicating the person's seat number and whether it is in the smoking or non-smoking section of the plane.

Use an array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available
Nov 10 '08 #1
6 22521
Banfa
9,065 Expert Mod 8TB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

Banfa
Administrator
Nov 10 '08 #2
this solution is for visual basic
ENJOY

[ off topic spoonfeeding solution deleted ]
Jan 1 '09 #3
weaknessforcats
9,208 Expert Mod 8TB
To devilprogrammer: This is a C/C++ forum. Visual Basic is not spoken here nor can you post complete solutions. Please do as Banfa asks and follow the posting guidelines.
Jan 1 '09 #4
i found it while searching in Visual Basic its solution but there was no solution available for it so i built this program for myself .... & thought why not to share it with others so they can get full marks....assignments are given to be done....
i don't care
Regards
devil programmer
Jan 1 '09 #5
JosAH
11,448 Expert 8TB
@devilprogrammer
This forum doesn't care about your off topic solution either so it has been deleted. Full marks are only to be deserved for original work, not for copying and pasting other people's spoonfeeding; don't do that anymore.

kind regards,

Jos (moderator)
Jan 1 '09 #6
Tassos Souris
152 100+
I think that the remark of the exercise already gives the solution:
Expand|Select|Wrap|Line Numbers
  1. int seats[ 11 ]; // if you want to start counting from 1 
  2. int smoking = 1; // where the seats for the Smoking-Category start
  3. int nonsmoking = 6; // where the seats for the Non-Smoking Category start
  4.  
  5. // initialize the seats[] to all zero if it is not already
  6.  
  7. // Read what the user wants (1 or 2) checking input.. Use a combination of
  8. // fgets() and strtol()
  9.  
  10. // If user wants the Smoking Category
  11.     // If there are more available seats for the smoking category 
  12.               (in which bounds should the smoking variable be?)
  13.         // Notify the user about the reservation (user fprintf())
  14.         // Update the seats[] array (assign 1 to the taken seat)
  15.     // Else (no more seats)
  16.         // Notify the user that no more seats are available (use fprintf())
  17.         // Use your own strategy here... you can ask user if he wants a seat
  18.         // in the Non-Smoking Category
  19.     // EndIf
  20. // Else (the user wants the Non-Smoking Category)
  21.     // The same as above (except you use the nonsmoking variable instead
  22.     // of the smoking variable
  23. // EndIf
  24.  
After you implement the above simple algorithm you can of course change it to use less if's and make it better,,,, It's up to you...

Hope i helped!
Jan 10 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Shane | last post by:
I am working on an airline res system. The technologies I am using are a mysql backend with Java and JSP pages pulling information. It is quite straight forward on my system to for example book a...
11
by: Robert | last post by:
Would you use Access to create a car rental reservation system? I would think that the complexity of such a system would be better suited to a procedural language like Visual Basic or C++. Your...
7
by: windandwaves | last post by:
Hi Folk Is there anyone out there in a hotel reservation system. I have written one over the last few years and I would like to know if anyone has a similar interest. > Nicolaas
1
by: hiboo | last post by:
Does anyone know of any open source java software/code libraries for doing travel/airline reservations? I'm looking for a typical airline (hotel, car rental?) reservation system. system in perl or...
1
by: Roy27 | last post by:
Hi, Can somebody please confirm if "Hertz Rent A Car" company's reservation system has XML API to develop software for integration with other 3rd party software? I apologize if I am putting...
1
by: tabloidster | last post by:
Howdy All, I recall seeing a similar post a while back, but I'm not an expert VB programmer so I'm still not clear... For my VB6 class, I've got to code a basic reservation system. Let's say...
2
by: cotty | last post by:
AIRLINE RESERVATION SYSTEM A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system in C. You are to write a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.