17.2.4 Airports
Finally, we present the class that represents the entire airport and provide the method that briefly describes the airport.
The |
|---|
// AIRPORTS
// The class that represents all places where people and aircraft meet
define class <airport> (<physical-object>)
// The name of the airport, such as "San Fransisco International Airport"
slot name :: <string>, init-keyword: name:;
// The three letter abbreviation, such as "SFO"
slot code :: <string>, init-keyword: code:;
// The airspace above the airport
slot sky-above :: <sky>;
end class <airport>;
define method say (airport :: <airport>) => ()
format-out("Airport %s", airport.code);
end method say;
|




