Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created March 4, 2012 07:54
Show Gist options
  • Save jacobh/1971165 to your computer and use it in GitHub Desktop.
Save jacobh/1971165 to your computer and use it in GitHub Desktop.
AircraftID Exercise
public class AircraftID {
public String registration;
public Pilot pilot;
public class Pilot {
public String name;
public int weight;
Public Pilot(String startName, int startWeight) {
name = startName;
weight = startWeight;
}
}
Public AircraftID(String startRegistration, String startPilotName, int startPilotWeight) {
pilot = new Pilot(startPilotName, startPilotWeight);
registration = startRegistration;
}
}
class AircraftID:
def __init__(self, registration='VH-NON', pilot=None):
self.registration = registration
self.pilot = pilot
class Pilot:
def __init__(self, name='No Name', weight=120):
self.name = name
self.weight = weight
pilot = Pilot('Jacob', 110)
aircraft = AircraftID('HZY-711', pilot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment