Airline Seat Reservation System

Welcome to the final project for CS1322. This project will require you to use all your previous knowledge of Java plus some of your new data structures knowledge. Please note that this problem is intentionally under-specified to provide you with the opportunity to do more system and user interface design. We will be evaluating your design as a vital component of the project.

Your objective is to successfully build a seat reservation system for Puddle Jumper Airways. Puddle Jumper Airways (PJA) was founded in 1922 by Sam "Crash and Burn" Rodgers.  Today it operates a fleet of 2 commuter planes serving the Southeastern United States. 

 

Aircraft Details

The aircraft are of the following types:

Quantity Type First Class Seats Coach Seats Seat Arrangement
1  Shorts 330 (N54320L) 8 22

 2  x 2 x 8 (last row has only 2 seats due to door)

Rows 1 and 2 are first class.

1  Cessna Super King Air (N300YR) 0 8 1 x 1 x 4

Shorts 330

Shorts 330 Picture 

              First Class|| Coach

CABIN SEATS:  +===============================================+

 Row:           1     2     3      4    5    6    7    8

Seats          =A=   =A=   =A=    =A=  =A=  =A=  =A=  =A=     

               =B=   =B=   =B=    =B=  =B=  =B=  =B=  =B=

                  AISLE             AISLE

               =C=   =C=   =C=    =C=  =C=  =C=  =C= 

               =D=   =D=   =D=    =D=  =D=  =D=  =D= 

             +==============================================+

Notes:  All A and D seats are window, all B and C seats are aisle


Cessna Super King Air

CABIN SEATS +==============+

Row:        1    2    3    4

Seats:     =A=  =A=  =A=  =A=

              AISLE

           =B=  =B=  =B=  =B=

           +===============+

Notes: All A and B seats are both window and aisle


  Assignment

Your assignment is to write a Java application to support the seat reservation system at Puddle Jumper Airways. Your application should allow the user to select between the aircraft in the PJA inventory.  Next, the passenger should enter their name and ticket number. Ticket numbers are a 12 character string with the Julian Date (i.e. 4030) followed by three character destination (ORL) followed by 5 additional digits.  A valid ticket would look like 4090DFW34126. Customer billing is handled by another application, so do not worry about what things cost.  Customers only use your application after they have a valid ticket. Finally, the appropriate plane seating chart should then be displayed. (Already occupied seats should be shown in one color and free seats in another.) Prospective passengers should then be allowed to select a seat using any of the following methods:

There is however the possibility that the application may be restarted many times, so you will need to make your data persistent.

Puddle Jumper Airways Employees should be able to print seating reports to the screen which display customer names, ticket numbers and assigned seats for each aircraft.  This report is organized by seat number. This means that you should also write out the data to to a particular file and load that file when the program is restarted so that the seat usage is made persistent.

Again, the flow for a customer is:
1. Choose flight.
2. Enter name and ticket number.
3. Select seats.

The flow for a PJA employee is:
1.Choose flight.
2.Ask for a seat report, customer report or to save data to file
3. If seat report is requested, print by aircraft to the screen (example only, your report can vary somewhat as long as it is by seatnumber):
Shorts 330
Seat       Name                  Ticket Number
 1A    Jones, Albert         4090DFW34126
 1B    Unoccupied
 1C    Smith, William       4090DFW55523
  ...
4. If a save is requested, prompt for a filename, or use an internally-generated name for persisting the data.  (If you use Serialization, you will not have to worry about save file format.)
5. If a customer report is requested, then print the contents of the SortedList to System.out.

User Interface

Part of this assignment is to design the user interface using the components you feel are best suited.  Obviously you need a way to switch between planes to show different seat configurations and various dialogs to obtain user information.  You will also need a way to switch between a customer using the system and a PJA employee.  You will also need a way for employees to display the customer list.  You also will need a way to display the seating report in the GUI.

Before the program exits, you need to be sure that you have made the data persistent, so if it is restarted it reloads available customer information and all seating information.

Data Structures

The underlying data structures are left to you, except that PJA wants the customer information (name, ticket number) kept in a Sorted List by last name in ascending order.  Each time a new customer is entered, the customer is inserted into the Sorted List such that the list is always kept in a sorted state.  At any time, PJA should be able to print to the console the sorted list of passengers with only the command System.out.println(sortedList);.  You must implement a sorted list class that provides the primary List interface methods like add, remove, get, toString, size, isEmpty, contains.  (See java.util.List for the complete List interface.  Any methods that are not applicable for a SortedList should throw an UnsupportedOperationException (provided in java.lang, see API).

Deliverables

The list of classes to be submitted will vary widely between students based upon the design and what graphical components you choose to use. All students need to have for sure the following classes:

Plane.java - An abstract base class.

SortedList.java - For keeping the passenger list.

MainGUI.java - We should be able to startup your application with java MainGUI.  (What goes into the GUI is part of your design)

Advice

Begin your design and program by doing important pieces. Implement the main GUI control without any actual functionality. Develop the working sorted list class. Model and design classes for the planes.

Extra Credit

TA's will have discretionary points for really good and unique user interface solutions.

While collaboration is allowed for the basic program, the following extra credit items MUST represent individual work.  Points represent MINIMUM points that might be awarded.  You points could be more depending upon you implementation.  Note that we will be checking your code to ensure that the extra credit work is individual.  Do not copy someones code for the extra credit work!!!!  The regular collaboration policy is in effect for the normal homework.  You can still get 50/50 using collaboration on the basic requirements.

OPTION 1: 3 POINTS

Validate ticket numbers:  The first four digits are the Julian date which is the last digit of the year (in this case 4) followed by a 3 digit number representing the day of the year.  Days start at 001 on Jan 1 and go to 365 on Dec 31 (for non-leap-year).  The next 3 letters represent a legal destination for the airplane.  This destination is shown as 3 Capital letters such as DFW or ORL.   The last 5 characters should be all digits and represent a special code.  The sum of the first 3 numbers should be evenly divisible by the sum of the last 2.  Thus 12333 is legal (1+2+3)/(3+3) = 6/6, but 12345 is not (6/9).

OPTION 2: 3 POINTS

Add a Boeing 737 aircraft to the PJA aircraft list.  The 737 has the following stats:

Quantity Type First Class Seats Coach Seats Seat Arrangement
1  Boeing 737-600 (N65302D) 24 120 First 2 x 2 x 2 x 4, Coach 2 x 3 x 2 x 10

 

CABIN SEATS      FIRST CLASS AREA     Coach Area

             +=====================+======================================+

Row:           1    2    3    4       5   6   7   8   9  10  11  12  14  15

Seats:        =A=  =A=  =A=  =A=     =A= =A= =A= =A= =A= =A= =A= =A= =A= =A=

              =B=  =B=  =B=  =B=     =B= =B= =B= =B= =B= =B= =B= =B= =B= =B=

                      AISLE                      AISLE                              

              =C=  =C=  =C=  =C=     =C= =C= =C= =C= =C= =C= =C= =C= =C= =C=

              =D=  =D=  =D=  =D=     =D= =D= =D= =D= =D= =D= =D= =D= =D= =D=

                                     =E= =E= =E= =E= =E= =E= =E= =E= =E= =E=

 

              =E=  =E=  =E=  =E=     =F= =F= =F= =F= =F= =F= =F= =F= =F= =F=

              =F=  =F=  =F=  =F=     =G= =G= =G= =G= =G= =G= =G= =G= =G= =G=

             +=============================================================+

Notes:  All A and F in first class and A and G in Coach are window seats.

        All B,C,D and E in first class and B,C,E, and F in Coach are aisle seats.

        C and D in first class and C, D and E in coach are center seating.

 

OPTION 3: 4 POINTS

  • Request for "sit together".  The customer would enter a number based upon the number of people in their party, and your application would search for contiguous seats.  For example a family of 4 traveling together on a Shorts 330 might be assigned all of row 3, or seats 4A 4B and 5A 5B.

    OPTION 4: 3 POINTS

  • If the customer criteria cannot be met (i.e. no more window seats) then notify them, and allow them to use another option.  If the criteria can be met only in a different class (i.e. you have a coach class ticket, but the only window seat is in first class) you may upgrade or downgrade your seat.

    Other extra credit could be arranged.  Check with the instructors or TA's prior to beginning work on an idea.  Remember to get the basic functionality working before spending time on extra credit.