Airline Reservation System
Airline Reservation System
h>
#include <stdlib.h>
#include <string.h>
#define MAX_FLIGHTS 10
#define MAX_NAME_LENGTH 50
int main() {
struct Flight flights[MAX_FLIGHTS];
int numFlights = 3; // You can change this to the desired number of flights
flights[2].flightNumber = 3;
strcpy(flights[2].destination, "Chicago");
flights[2].seatsAvailable = 20;
flights[2].fare = 350.0;
int choice;
do {
printf("Airline Reservation System:\n");
printf("1. Display available flights\n");
printf("2. Make a reservation\n");
printf("3. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
displayFlights(flights, numFlights);
break;
case 2:
makeReservation(flights, numFlights);
break;
case 3:
printf("Goodbye!\n");
break;
default:
printf("Invalid choice. Please try again.\n");
}
} while (choice != 3);
return 0;
}