Created
March 4, 2012 07:54
-
-
Save jacobh/1971165 to your computer and use it in GitHub Desktop.
AircraftID Exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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