
12 }
13
14
SetWeight( plane current, int W ){
15 Current.Weight = W;
16 }
17
18
/* Additional Methods for SetSpeed, SetWeight, SetPosition, SetManeuverability,
SetPosition defined here */
19 }
This code is used to initialize a plane object. A calling method specifies each of the
required options that a plane object must have—in this case, a weight, a speed, a maneu-
verability rating, and a position.The SetWeight example demonstrates how operations
on an object may be contained within the class that defines that object.
A simulation program may create multiple instances of the plane class and run a set
of “test flights.”To test different plane characteristics, ...