The Java Program: Aircraft.java

  1 import java.util.Date;
  2 
  3 class Aircraft {
  4 
  5    private double altitude = 0;   // 1,000 of feet
  6    private double airspeed = 0;   // knots (nautical miles per hour)
  7    private String identification;
  8    private String origin, destination;  // handoff fix or airport
  9    private Date   ETA;                  // estimated time of arrival GMT
 10 
 11    /*
 12      Setter methods
 13    */
 14    public void setAltitude (double a)   { altitude=a; }
 15    public void setAirspeed (double a)   { airspeed=a; }
 16    public void setIdentification (String id) { identification=id; }
 17    public void setOrigin (String x)       { origin=x; }
 18    public void setDestination (String x)  { destination=x; }
 19    public void getETA (Date d)            { ETA=d; }
 20 
 21    /*
 22      Getter methods
 23    */
 24    public double getAltitude ()     { return altitude; }
 25    public double getAirspeed ()     { return airspeed; }
 26    public String getIdentification () { return identification; }
 27    public String getOrigin ()       { return origin; }
 28    public String getDestination ()  { return destination; }
 29    public Date   getETA ()          { return ETA; }
 30 
 31    public String toString () {
 32       return identification;
 33    }
 34 }