Thread: Pls Help: Assigning of Passenger Seat

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    1

    Pls Help: Assigning of Passenger Seat

    How to assign seat for passenger in airline system using C Programming.Your help is very much appreciated..

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    26
    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!

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. assigning value
    By AndreyS10 in forum C++ Programming
    Replies: 5
    Last Post: 10-17-2011, 12:13 PM
  2. Assigning something
    By Jasper in forum C Programming
    Replies: 14
    Last Post: 10-13-2009, 01:58 AM
  3. assigning values
    By alex_6169 in forum C Programming
    Replies: 7
    Last Post: 05-15-2006, 02:16 AM
  4. creating a cinema seat
    By SweeLeen in forum C++ Programming
    Replies: 2
    Last Post: 01-05-2006, 03:34 AM
  5. Assigning
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-08-2001, 06:29 PM