How to assign seat for passenger in airline system using C Programming.Your help is very much appreciated..
How to assign seat for passenger in airline system using C Programming.Your help is very much appreciated..
Something else that is appreciated as well.
Announcements - C Programming
Reading our homework policy.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I think more information would definitely be helpful. What are the parameters? Is the seating constant? Can the customer's request specific seats? Should groups be seated together? Should people be seated in ways that insure greater spacing or compactly toward the door?
I think you have two basic problems. First, you need to define the best data type or structure to emulate the seating (a 2D array might work). And second to consider your parameters and start writing functions for adding and removing passengers based on those parameters.
good luck!
I'll give you a suggestion: Use an array of structs to hold together all the variables that relate to a seat: the seat #, the row, the aisle, is it reserved, or assigned, and to whom, etc.
But we won't get your program code started for you (99.9% of the time, at least). You have been in the class, reading the manual/book, listening to the lectures, you know the assignment WAY better than we do, and it IS your assignment.
It's up to you to get this whole thing started, in code or in pseudo code, and when (if) you get stuck on some issue of C coding, THEN post up some specific questions or problems. Note especially that "it doesn't work", isn't specific enough to generally get a good answer. (Sometimes yes, but not generally).
A good place to start is doing it a few (possibly several) times by hand on paper, first. Generally, humans are lazy, and do things rather efficiently if you let them. As you do this, you'll begin to notice certain patterns you're performing, and the order you're performing them in. Those patterns can help form the backbone of your programs logic, in pseudo code. Just keep the "higher reasoning" skills, out of it. Your computer has tons of speed, but not an ounce of education outside of math.