Commit be0f6044 authored by 9731073's avatar 9731073

upload1

parent 09e60979
import java.util.ArrayList;
public class Airplane {
String type;
ArrayList<Seat> seats =new ArrayList<>();
public Airplane(String type){
this.type=type;
}
public String getType(){
return type;
}
public void reserveSeat(Seat s){
seats.add(s);
}
}
public class DateAndTime {
int day;
int hour;
int minute;
public DateAndTime(int day,int hour,int minute){
this.day=day;
this.hour=hour;
this.minute=minute;
}
}
import java.util.ArrayList;
public class Flight {
int day;
int hour;
int minute;
int id;
String destination;
String source;
String company;
Airplane airplane;
DateAndTime dateAndTime;
public Flight(int id,String source,String destination,String company,String airplaneType,int day,int hour,int minute){
dateAndTime=new DateAndTime(day,hour,minute);
airplane=new Airplane(airplaneType);
this.destination=destination;
this.source=source;
this.company=company;
this.id=id;
}
public int getId(){
return id;
}
public String getDestination(){
return destination;
}
public String getSource(){
return source;
}
public String getCompany(){
return company;
}
public Airplane getAirplane(){
return airplane;
}
public DateAndTime getDateTime(){
return dateAndTime;
}
}
public class Seat {
String type;
int number;
User user;
public Seat(int number,String type){
this.type=type;
this.number=number;
}
public String getType(){
return type;
}
public int getNumber(){
return number;
}
public void setUser(String userFirstName,String userFamilyName,int userId){
user=new User(userFirstName,userFamilyName,userId);
}
public User getUser(){
return user;
}
}
public class System {
}
public class Ticket {
}
import java.util.ArrayList;
public class User {
String firstName;
String lastName;
int id;
ArrayList<Ticket> tickets=new ArrayList<>();
public User(String firstName,String lastName,int id){
this.firstName=firstName;
this.lastName=lastName;
this.id=id;
}
public String getFirstName(){
return firstName;
}
public String getLastName(){
return lastName;
}
public int getId(){
return id;
}
public void reserve(Seat seat,Boolean food,int weight){
}
}
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