Commit 3a2671b3 authored by Roonak's avatar Roonak

lab7

parents
Pipeline #621 failed with stages
package com.company.Plane;
import com.company.Ticket;
import java.util.ArrayList;
public class Customer {
private String firstName;
private String lastName;
private int ID;
ArrayList<Ticket> reserved = new ArrayList<>();
Ticket ticket = new Ticket();
public Customer(String firstName , String lastName , int ID){
this.firstName = firstName;
this.lastName = lastName;
this.ID = ID;
}
public void setCustomer(String firstName , String lastName , int ID){
this.firstName = firstName;
this.lastName = lastName;
this.ID = ID;
}
public void addTicket(Ticket t){
reserved.add(t);
}
public void removeTicket(Ticket t){
reserved.remove(t);
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public int getID() {
return ID;
}
public ArrayList getReserved(){
return reserved;
}
}
\ No newline at end of file
package com.company;
public class Date {
private int day;
private int month;
private int year;
public Date(int day , int month , int year){
this.day = day;
this.month = month;
this.year = year;
}
public void setDate(int day , int month , int year) {
this.day = day;
this.month = month;
this.year = year;
}
@Override
public String toString() {
return "day" + "/" + "month" + "year";
}
}
package com.company;
public class Flight {
private int flightNum;
private String flightType;
private String source;
private String dest;
private String companyName;
private Time time;
private Date date;
public Flight(int flightNum , String flightType , String source , String dest , String companyName) {
this.flightNum = flightNum;
this.flightType = flightType;
this.source = source;
this.dest = dest;
this.companyName = companyName;
}
public void setFlightNum(int flightNum) {
this.flightNum = flightNum;
}
public void setFlightType(String flightType) {
this.flightType = flightType;
}
public void setSource(String source) {
this.source = source;
}
public void setDest(String dest) {
this.dest = dest;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public int getFlightNum() {
return flightNum;
}
public String getFlightType() {
return flightType;
}
public String getSource() {
return source;
}
public String getDest() {
return dest;
}
public String getCompanyName() {
return companyName;
}
}
\ No newline at end of file
package com.company.Plane;
import java.util.ArrayList;
public class Plane {
private String planeType;
ArrayList<Seat> seats = new ArrayList<>();
public Plane(String planeType){
this.planeType = planeType;
}
public void setPlaneType(String planeType) {
this.planeType = planeType;
}
public String getPlaneType(){
return planeType;
}
public ArrayList getSeats(){
return seats;
}
}
\ No newline at end of file
package com.company.Plane;
public class Seat {
private int seatID;
private String seatType;
private boolean seatStatus;
public Seat(){
this.seatID = 0;
this.seatType = null;
}
public Seat(int seatNum , String seatType){
this.seatID = seatNum;
this.seatType = seatType;
}
public void setSeatStatus() {
this.seatStatus = true;
}
public int getSeatID() {
return seatID;
}
public String getSeatType() {
return seatType;
}
public boolean isSeatStatus() {
return seatStatus;
}
}
\ No newline at end of file
package com.company;
import com.company.Plane.Seat;
import java.util.ArrayList;
public class System {
ArrayList<Flight> flights = new ArrayList<>();
public void addFlight(Flight flight){
flights.add(flight);
}
public void removeFlight(Flight flight){
flights.remove(flight);
}
}
package com.company;
import com.company.Plane.Seat;
public class Ticket {
private int seatNum;
private int flightNum;
private int customerLoad;
private boolean foodStatus;
public Ticket(int seatNum , int flightNum , int customerLoad){
this.seatNum = seatNum;
this.flightNum = flightNum;
this.customerLoad = customerLoad;
this.foodStatus = false;
}
public void setFoodStatus(boolean foodStatus) {
this.foodStatus = foodStatus;
}
public int getSeatNum() {
return seatNum;
}
public int getFlightNum() {
return flightNum;
}
public int getCustomerLoad() {
return customerLoad;
}
public boolean isFoodStatus() {
return foodStatus;
}
}
package com.company;
public class Time {
private int hour;
private int minute;
private int second;
public Time(int hour, int minute, int second) {
this.hour = hour;
this.minute = minute;
this.second = second;
}
public void setTime(int hour , int minute , int second) {
this.hour = hour;
this.minute = minute;
this.second = second;
}
@Override
public String toString() {
return "hour" + ":" + "minute" + ":" + "second";
}
}
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