This project is a console-based flight booking system implemented in C++ using object-oriented programming. It allows users to add flights, book tickets for passengers, list current bookings, and export booking data to a CSV file for persistence.
- Add new flights with a unique flight number and seat capacity
- Book flights for passengers with automatic seat availability check
- List all existing bookings
- Export booking data to a CSV file (
bookings.csv) - Automatically reload bookings from the CSV file (if present) on startup
Represents a passenger with:
nameid
Includes methods for:
- Converting to/from CSV strings
Represents a flight with:
flightNumberseats(total capacity)booked(seats already booked)
Includes:
- Seat availability checks
- Booking a seat
- Conversion to CSV format
Handles:
- Booking logic
- Flight and passenger storage
- CSV file export and import
- In-memory management using
vector
When the program starts, it:
- Loads previous bookings (if
bookings.csvexists) - Adds some sample flights
- Prompts the user with a menu to:
- Add a new flight
- Book a flight for a passenger
- Display all bookings
- Export to CSV
- Exit
PassengerName,PassengerID,FlightNumber
sam 23325 444
mary 4242 333
milly 3252 333