how to write airline reservation system program in c.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • latalui
    New Member
    • Sep 2008
    • 10

    how to write airline reservation system program in c.

    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
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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

    Comment

    • devilprogrammer
      New Member
      • Jan 2009
      • 2

      #3
      solution for ur problem! no worries when DEVIL PROGRAMMER is here

      this solution is for visual basic
      ENJOY

      [ off topic spoonfeeding solution deleted ]

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        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.

        Comment

        • devilprogrammer
          New Member
          • Jan 2009
          • 2

          #5
          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....assign ments are given to be done....
          i don't care
          Regards
          devil programmer

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by devilprogrammer
            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....assign ments are given to be done....
            i don't care
            Regards
            devil programmer
            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)

            Comment

            • Tassos Souris
              New Member
              • Aug 2008
              • 152

              #7
              I think that the remark of the exercise already gives the solution:
              Code:
              int seats[ 11 ]; // if you want to start counting from 1 
              int smoking = 1; // where the seats for the Smoking-Category start
              int nonsmoking = 6; // where the seats for the Non-Smoking Category start
              
              // initialize the seats[] to all zero if it is not already
              
              // Read what the user wants (1 or 2) checking input.. Use a combination of
              // [B]fgets() [/B]and [B]strtol()
              
              [/B]// If user wants the Smoking Category
                  // If there are more available seats for the smoking category 
                            (in which bounds should the [I]smoking[/I] variable be?)
                      // Notify the user about the reservation (user [B]fprintf())
                      [/B]// Update the seats[] array (assign 1 to the taken seat)
                  // Else (no more seats)
                      // Notify the user that no more seats are available (use [B]fprintf()[/B])
                      // Use your own strategy here... you can ask user if he wants a seat
                      // in the Non-Smoking Category
                  // EndIf
              // Else (the user wants the Non-Smoking Category)
                  // The same as above (except you use the [I]nonsmoking [/I]variable instead
                  // of the [I]smoking [/I]variable
              // EndIf
              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!

              Comment

              Working...