This particular airline only has one size plane, which has 32 rows and row 16 is always the exit row. Rows are numbered 1 to 32. Also, there are always six seats in a row labeled A to F. Seats A and F are window seats. Seats C and D are aisle seats. The others are middle seats.
The airline includes some special features. First, it gives a discount of 15% off the fare to children and seniors. Children include all passengers 12 and under. Seniors include all passengers 65 and older. They also offer special meals to passengers willing to pay an extra $10. This price is not discounted for any passenger. The special meal options are vegetarian, low carb, and kosher.
The airline imposes some rules when assigning rows, seats, and meals. Passengers must be assigned to a valid row, and children cannot sit in the exit row. Passengers must be assigned a valid seat, and passengers must either choose one of the special meals or have no meal preference.
In addition the airline offers group tickets. All passengers in a group must fly on the same flight. A group recieves an additional 10% discount off the entire price including any special meals if there 8 or more people in the group.
AirlineBooking(String name, int age, int flightNum, GregorianCalendar dateTime, double fare) The row and seat data fields should be assigned default values that indicate that the attributes have not yet been set. The default meal preference is "No Preference".
Name: <Person's name> [(Child)|(Senior)] *[] indicate optional values and | means or Flight: <Flight Number> on <Date> Row: <Row Number> Seat: <Seat Letter> (<Seat Location>) Meal: <Meal Preference> Price: <Price including discounts and meals>The following are some sample profiles:
Name: Baby (Child) Flight: 1920 on 12/12/05 8:30 AM Row: 6 Seat: B (Middle) Meal: No Preference Price: $209.09 Name: Dad Flight: 1920 on 12/12/05 8:30 AM Row: 6 Seat: C (Aisle) Meal: Kosher Price: $255.99 Name: Gramma (Senior) Flight: 1920 on 12/12/05 8:30 AM Row: 6 Seat: A (Window) Meal: Low Carb Price: $219.09* Remember the DateFormat for the GregorianCalendar and use NumberFormat for the price.
You will also write a class AirlineGroupBooking which books a group of passengers that are all on the same flight. The class should include the following attributes:
********** PASSENGER 1************* Name: Donald Flight: 630 on 11/11/05 2:52 PM Row: 5 Seat: A(Window) Meal: No Preference Price: $220.99 ********** PASSENGER 2************* Name: Mickey Flight: 630 on 11/11/05 2:52 PM Row: 5 Seat: B(Middle) Meal: No Preference Price: $220.99 ********** PASSENGER 3************* Name: Minnie Flight: 630 on 11/11/05 2:52 PM Row: 5 Seat: C(Aisle) Meal: Low Carb Price: $230.99 *********************************** Grand Total: $682.97
You should also write a test driver, AirlineTest, to test your methods in both AirlineBooking and AirlineGroupBooking thoroughly. I'm interested in "white-box" testing where all paths are tested, especially exceptions.
This project may take between 30 and 40 hours to complete.