import java.util.ArrayList;
import java.util.List;
// Hava Yolu Şirketi
class AirlineCompany {
private List<Airport> airports;
private List<Flight> flights;
this.name = name;
this.code = code;
this.airports = new ArrayList<>();
this.flights = new ArrayList<>();
}
public void addAirport(Airport airport) {
airports.add(airport);
}
public void addFlight(Flight flight) {
flights.add(flight);
}
// Getter ve Setter metodları
return name;
}
return code;
}
public List<Airport> getAirports() {
return airports;
}
public List<Flight> getFlights() {
return flights;
}
}
// Havalimanı
class Airport {
this.name = name;
this.address = address;
this.code = code;
this.manager = manager;
}
// Getter ve Setter metodları
return name;
}
return address;
}
return code;
}
return manager;
}
}
// Uçak
class Aircraft {
private int capacity;
private int productionYear;
private List<String> crewMembers;
public Aircraft
(String type,
int capacity,
int productionYear
) { this.type = type;
this.capacity = capacity;
this.productionYear = productionYear;
this.crewMembers = new ArrayList<>();
}
// Getter ve Setter metodları
return type;
}
public int getCapacity() {
return capacity;
}
public int getProductionYear() {
return productionYear;
}
}
// Uçuş
class Flight {
private Airport departureAirport;
private Airport arrivalAirport;
private Aircraft aircraft;
public Flight
(String flightNumber, Airport departureAirport, Airport arrivalAirport, Aircraft aircraft,
String flightTime,
String flightDate,
String gate,
String status
) { this.flightNumber = flightNumber;
this.departureAirport = departureAirport;
this.arrivalAirport = arrivalAirport;
this.aircraft = aircraft;
this.flightTime = flightTime;
this.flightDate = flightDate;
this.gate = gate;
this.status = status;
}
// Getter ve Setter metodları
public String getFlightNumber
() { return flightNumber;
}
}
// Konum
class Location {
this.country = country;
this.city = city;
}
// Getter ve Setter metodları
return country;
}
return city;
}
}
// Uçuş Rezervasyonu
class Reservation {
private String reservationNumber
; private List<Person> passengers;
private List<Seat> assignedSeats;
public Reservation
(String reservationNumber
) { this.reservationNumber = reservationNumber;
this.passengers = new ArrayList<>();
this.assignedSeats = new ArrayList<>();
}
// Getter ve Setter metodları
public String getReservationNumber
() { return reservationNumber;
}
}
// Güzergah
class Route {
private Airport departureAirport;
private Airport arrivalAirport;
public Route
(Airport departureAirport, Airport arrivalAirport,
String creationDate
) { this.departureAirport = departureAirport;
this.arrivalAirport = arrivalAirport;
this.creationDate = creationDate;
}
// Getter ve Setter metodları
}
// Uçuş Koltuğu
class Seat {
private boolean isReserved;
public Seat
(String seatNumber
) { this.seatNumber = seatNumber;
this.isReserved = false;
}
// Getter ve Setter metodları
public String getSeatNumber
() { return seatNumber;
}
}
// Kişi
class Person {
private String role
; // Customer, Pilot, Crew, Admin
this.name = name;
this.role = role;
}
// Getter ve Setter metodları
return name;
}
return role;
}
}
// Ödeme
class Payment {
private double amount;
public Payment
(double amount,
String paymentMethod
) { this.amount = amount;
this.paymentMethod = paymentMethod;
this.status = "Pending";
}
// Getter ve Setter metodları
public double getAmount() {
return amount;
}
public String getPaymentMethod
() { return paymentMethod;
}
return status;
}
}
// Ana sınıf
public class Main {
public static void main
(String[] args
) { // Havayolu şirketi oluştur
AirlineCompany airline = new AirlineCompany("Example Airline", "EA");
// Havalimanları oluştur
Airport airport1 = new Airport("Istanbul Airport", "Istanbul, Turkey", "IST", "Mr. Smith");
Airport airport2 = new Airport("London Heathrow", "London, UK", "LHR", "Mrs. Johnson");
// Havalimanlarını havayolu şirketine ekle
airline.addAirport(airport1);
airline.addAirport(airport2);
// Uçak oluştur
Aircraft aircraft = new Aircraft("Boeing 737", 180, 2015);
// Uçuş oluştur
Flight flight = new Flight("EA123", airport1, airport2, aircraft, "10:00", "2024-12-01", "A1", "Scheduled");
// Uçuşu havayolu şirketine ekle
airline.addFlight(flight);
// Bilgileri yazdır
System.
out.
println("Havayolu Şirketi: " + airline.
getName()); System.
out.
println("Uçuş Eklendi: " + flight.
getFlightNumber()); }
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuTGlzdDsKCi8vIEhhdmEgWW9sdSDFnmlya2V0aQpjbGFzcyBBaXJsaW5lQ29tcGFueSB7CiAgICBwcml2YXRlIFN0cmluZyBuYW1lOwogICAgcHJpdmF0ZSBTdHJpbmcgY29kZTsKICAgIHByaXZhdGUgTGlzdDxBaXJwb3J0PiBhaXJwb3J0czsKICAgIHByaXZhdGUgTGlzdDxGbGlnaHQ+IGZsaWdodHM7CgogICAgcHVibGljIEFpcmxpbmVDb21wYW55KFN0cmluZyBuYW1lLCBTdHJpbmcgY29kZSkgewogICAgICAgIHRoaXMubmFtZSA9IG5hbWU7CiAgICAgICAgdGhpcy5jb2RlID0gY29kZTsKICAgICAgICB0aGlzLmFpcnBvcnRzID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICAgICAgdGhpcy5mbGlnaHRzID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICB9CgogICAgcHVibGljIHZvaWQgYWRkQWlycG9ydChBaXJwb3J0IGFpcnBvcnQpIHsKICAgICAgICBhaXJwb3J0cy5hZGQoYWlycG9ydCk7CiAgICB9CgogICAgcHVibGljIHZvaWQgYWRkRmxpZ2h0KEZsaWdodCBmbGlnaHQpIHsKICAgICAgICBmbGlnaHRzLmFkZChmbGlnaHQpOwogICAgfQoKICAgIC8vIEdldHRlciB2ZSBTZXR0ZXIgbWV0b2RsYXLEsQogICAgcHVibGljIFN0cmluZyBnZXROYW1lKCkgewogICAgICAgIHJldHVybiBuYW1lOwogICAgfQoKICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q29kZSgpIHsKICAgICAgICByZXR1cm4gY29kZTsKICAgIH0KCiAgICBwdWJsaWMgTGlzdDxBaXJwb3J0PiBnZXRBaXJwb3J0cygpIHsKICAgICAgICByZXR1cm4gYWlycG9ydHM7CiAgICB9CgogICAgcHVibGljIExpc3Q8RmxpZ2h0PiBnZXRGbGlnaHRzKCkgewogICAgICAgIHJldHVybiBmbGlnaHRzOwogICAgfQp9CgovLyBIYXZhbGltYW7EsQpjbGFzcyBBaXJwb3J0IHsKICAgIHByaXZhdGUgU3RyaW5nIG5hbWU7CiAgICBwcml2YXRlIFN0cmluZyBhZGRyZXNzOwogICAgcHJpdmF0ZSBTdHJpbmcgY29kZTs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