This Java-based Flight Booking System enables users to search for flights between two cities and choose their preferred flight mode (cheapest or shortest). The system also integrates currency conversion to convert flight prices from EUR to PKR using an external API.
The system interacts with flight data through an API, validates user input, and recommends flights based on user preferences. It also includes classes that load airport and airline data from CSV files to make the experience more dynamic.
- Select an origin and destination country.
- Fetches flight data via an external API.
- Choose between two flight options:
- Cheapest Flight 🏷️
- Shortest Flight ⏱️
- Ensures that the flight date is valid and not in the past ⏳.
- Converts flight prices from EUR to PKR using a currency conversion API 💰.
- Displays flight prices in PKR 💸.
- Loads airport and airline data from CSV files for dynamic flight searching.
- Classes like AirportLoader and AirlineLoader handle data loading, making the system more flexible.
- Validates all user inputs to ensure the system operates without errors 🔍.
- Handles invalid inputs, API failures, and empty fields gracefully 🚨.
To run this project, you’ll need the following installed:
- Java 11+: The project is built in Java.
- Maven (Optional): If you're using Maven, dependencies will be automatically managed.
git clone [https://github.com/yourusername/flight-booking-system.git](https://github.com/abdullahimran49/FlyPath.git)- Install dependencies (if using Maven):
mvn install- Run the program:
javac App.java
java AppThe system uses the following classes to load data from CSV files:
- Loads and parses airport data from CSV files.
- Provides airport details like code and country.
- Loads and parses airline data from CSV files.
- Provides airline details like name, IATA code, and flights available.
- Place the airports.csv and airlines.csv files in the project directory or specify their location in the program's configuration.
Here are the key classes in the system:
- FlightBookingSystem.java - Main entry point to run the system and interact with users.
- AirportLoader.java - Handles the loading of airport data from the CSV file.
- AirlineLoader.java - Handles the loading of airline data from the CSV file.
- CurrencyConverter.java - Fetches real-time currency rates and converts EUR to PKR.
- FlightSearch.java - Handles the flight search logic, determining whether the user wants the cheapest or shortest flight.
- UserInputValidator.java - Ensures all inputs from the user are valid.
- Java 🟨
- CSV File Parsing 📂
- External APIs for flight data and currency conversion 🌐
- Maven (Optional) 📦
- Launch the program.
- Enter the origin and destination countries.
- Select the flight mode (cheapest or shortest).
- View the flight options.
- Enter the flight date.
- Get the converted price in PKR.
- GitHub: abdullahimran49
- Email: [email protected]