Commit e5464570 authored by Amirhosein Rajabpour's avatar Amirhosein Rajabpour

half complete

parent e658926e
package com.TicketManagement;
public class Airplane {
private int seats;
private String airplaneagency;
public Airplane(int seats,String airplaneagency){
this.seats=seats;
this.airplaneagency=airplaneagency;
}
public int getSeats() {
return seats;
}
public String getAirplaneagency() {
return airplaneagency;
}
}
package com.TicketManagement;
import java.util.ArrayList;
public class Customer {
private String name,lastname;
private int ID;
private ArrayList<Ticket> tickets= new ArrayList<Ticket>();
public Customer(String name,String lastname,int ID){
this.name=name;
this.ID=ID;
this.lastname=lastname;
}
public void addTicket(Ticket ticket){
tickets.add(ticket);
}
public ArrayList<Ticket> getTickets() {
return tickets;
}
public int getID() {
return ID;
}
public String getName() {
return name;
}
public String getLastname() {
return lastname;
}
}
package com.TicketManagement;
import java.util.Date;
public class Flight {
private Date date;
private String destination;
private Airplane airplane;
private int flightNumber;
private String start;
public Flight(Date date,int flightNumber,String destination,String start,Airplane airplane){
this.date=date;
this.start=start;
this.airplane=airplane;
this.destination=destination;
this.flightNumber=flightNumber;
}
public int getFlightNumber() {
return flightNumber;
}
public String getStart() {
return start;
}
public Airplane getAirplane() {
return airplane;
}
public Date getDate() {
return date;
}
public String getDestination() {
return destination;
}
}
package com.TicketManagement;
public class Seat {
private int ID;
private String kind;
private int userID;
public Seat(int ID,String kind,int userID){
this.kind=kind;
this.ID=ID;
this.userID = userID;
}
public int getID() {
return ID;
}
public String getKind() {
return kind;
}
public int getUserID(){ return userID;}
}
package com.TicketManagement;
public class Ticket {
private int seatnumber;
private int flightnumber;
private int cargo;
private String meal;
public Ticket(int seatnumber,int flightnumber,int cargo,String meal){
this.flightnumber=flightnumber;
this.seatnumber=seatnumber;
this.cargo=cargo;
this.meal=meal;
}
public int getCargo() {
return cargo;
}
public String getMeal() {
return meal;
}
public int getFlightnumber() {
return flightnumber;
}
public int getSeatnumber() {
return seatnumber;
}
}
package com.TicketManagement;
import java.util.ArrayList;
public class TicketManagement {
private ArrayList<Flight> flights=new ArrayList<Flight>();
private ArrayList<Customer> customers= new ArrayList<Customer>();
private ArrayList<Airplane> airplanes= new ArrayList<Airplane>();
public ArrayList<Flight> getFlights() {
return flights;
}
public ArrayList<Customer> getCustomers() {
return customers;
}
public ArrayList<Airplane> getAirplanes() {
return airplanes;
}
public void addAirplane(Airplane airplane){
airplanes.add(airplane);
}
public void addCustomer(Customer customer){
customers.add(customer);
}
public void addFlight(Flight flight){
flights.add(flight);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment