02.26.06

Computer Science II – Assignment #3

Posted in ALPHA, Computer Science, Programming at 4:38 pm by Nick

Time: 5 hours
Total: 42 hours
———————-

This project was actually fairly interesting, as it enabled me to play with maps (which is an STL class for associative arrays). It took forever to finish, but I did get it done. Here’s the low down (copied from the actual requirements):

Assignment 3. An airline reservation system class.

1. You have flights with numbers like FTA-100, FTA-105, FTA-200, etc. (Flying Tomato Airlines).
2. Each flight has a captain, co-captain and head flight attendant.
3. Each flight has an origin city and a destination city.
4. Each flight has 50 ailse seats and 50 window seats organized as 2 by 2 with an aisle down the middle.
5. Some seats have passengers. Some passengers prefer ailse, some prefer window seats.
6. Passengers have connecting flights, meal preferences (chicken, beef or vegitarian), first and last names.
7. Your system has the following functions:

  • Create a flight: CreateFlight(“FTA-100″).
  • Set captain: SetCaptain(“FTA-100″,”John Jones”);
  • Set co-captain.
  • Set flight attendant.
  • Set origin city.
  • Set destination city.
  • Assign an aisle seat to a passenger. (seat is assigned when there is a name associated with it)
  • Assign a window seat to a passenger.
  • Assign menu item.
  • List flights
  • List flights and crews.
  • List flights by origin city
  • List flights by destination
  • List passengers by seat.
  • List passengers by seat and meal choice.
  • Free a seat (passenger switched airlines).
  • Delete a flight.
  • The test flights are hard coded, so if you want to add your own or change things around you will have to modify the source and recompile. You can download the actual source this time at:

    http://www.nick-cash.com/download/cs2/3/main.cpp
    http://www.nick-cash.com/download/cs2/3/main.h

    Or you can view the source exported (like normal) and download the Win32 binary at:

    http://www.nick-cash.com/download/cs2/3/

    Leave a Comment