Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Avion
- {
- private String planeID;
- private int totalEnginePower;
- public Avion(String s, int ep)
- {
- planeID = s;
- totalEnginePower = ep;
- }
- public void takeOff()
- {
- System.out.println(getPlaneID() + " - Initiating takeoff procedure - Starting engines - Accelerating down the runway - Taking off - Retracting gear - Takeoff complete");
- }
- public void land()
- {
- System.out.println(getPlaneID() + " - Initiating landing procedure - Enabling airbrakes - Lowering gear - Contacting runway - Decelerating - Stopping engines - Landing complete");
- }
- public void fly()
- {
- System.out.println(getPlaneID() + " - Flying");
- }
- public int getTotalEnginePower()
- {
- return totalEnginePower;
- }
- public String getPlaneID()
- {
- return planeID;
- }
- }
- class avionCalatori extends Avion
- {
- private int maxPassengers;
- public avionCalatori(String s, int ep, int mp)
- {
- super(s, ep);
- maxPassengers = mp;
- }
- public int getMaxPassengers()
- {
- return maxPassengers;
- }
- }
- class Boeing extends avionCalatori
- {
- public Boeing(String s, int ep, int mp)
- {
- super(s, ep, mp);
- }
- }
- class Concorde extends avionCalatori
- {
- public Concorde(String s, int ep, int mp)
- {
- super(s, ep, mp);
- }
- public void goSuperSonic()
- {
- System.out.println(getPlaneID() + " - Supersonic mode activated");
- }
- public void goSubSonic()
- {
- System.out.println(getPlaneID() + " - Supersonic mode deactivated");
- }
- }
- class avionLupta extends Avion
- {
- public avionLupta(String s, int ep)
- {
- super(s, ep);
- }
- public void launchMissile()
- {
- System.out.println(getPlaneID() + " Initiating missile launch procedure - Acquiring target - Launching missile - Breaking away - Missile launch complete");
- }
- }
- class TomCat extends avionLupta
- {
- public TomCat(String s, int ep)
- {
- super(s, ep);
- }
- public void refuel()
- {
- System.out.println(getPlaneID() + " - Initiating refueling procedure - Locating refueller - Catching up - Refueling - Refueling complete");
- }
- }
- class Mig extends avionLupta
- {
- public Mig(String s, int ep)
- {
- super(s, ep);
- }
- public void highSpeedGeometry()
- {
- System.out.println(getPlaneID() + " - High speed geometry selected");
- }
- public void normalGeometry()
- {
- System.out.println(getPlaneID() + " - Normal geometry selected");
- }
- }
- class Client
- {
- public static void main(String[] args)
- {
- Boeing b1, b2;
- Concorde c1, c2;
- TomCat tc1, tc2;
- Mig m1, m2;
- b1 = new Boeing("BO-100", 1000, 750);
- b2 = new Boeing("BO-101", 1500, 1000);
- c1 = new Concorde("CO-200", 900, 500);
- c2 = new Concorde("CO-201", 1000, 700);
- tc1 = new TomCat("TCAT-1000", 1500);
- tc2 = new TomCat("TCAT-1002", 1000);
- m1 = new Mig("MIG-1005", 1250);
- m2 = new Mig("MIG-1010", 1300);
- b1.takeOff();
- c1.takeOff();
- tc1.takeOff();
- m2.takeOff();
- b1.fly();
- c1.fly();
- tc1.fly();
- m2.fly();
- c1.goSuperSonic();
- m1.highSpeedGeometry();
- tc1.refuel();
- }
- }
Add Comment
Please, Sign In to add comment