public class Airline
{
private String flightCode;
private String departAirport;
private String arrivalAirport;
private String nameOfReservee;
private int priceSeat;
/* Our Constructor */
public Airline()
{
flightCode = "";
departAirport = "";
arrivalAirport = "";
nameOfReservee = "";
priceSeat = 0;
}
public Airline (String cFlightCode, String cDepartAirport, String cArrivalAirport, String cNameOfReservee, int cPriceSeat)
{
flightCode = cFlightCode;
departAirport = cDepartAirport;
arrivalAirport = cArrivalAirport;
nameOfReservee = cNameOfReservee;
priceSeat = cPriceSeat;
}
/* Methods for setting the FlightCode, Departure Airport, Arrival Airport, Name of the Reservee
* and the price of the seat
*/
public void setFlightCode(String newFlightCode)
{
flightCode = newFlightCode;
}
public void setDepartAirport(String newDepartAirport)
{
departAirport = newDepartAirport;
}
/* Create the other three public void methods for setting the private variables */
/* ... */
/* Methods to return the private variables stored in this class */
public String getFlightCode()
{
return flightCode;
}
public String getDepartAirport()
{
return departAirport;
}
/* Create the three other public methods which return the private variables */
/* ... */
public void printDetails()
{
System.out.println("Flight Code = " + flightCode);
System.out.println("Arrival Airport = " + arrivalAirport);
System.out.println("Departure Airport = " + departAirport);
System.out.println("Name of Reservee = " + nameOfReservee);
System.out.println("Price of Seat (IR) = " + priceSeat);
}
}