akxk + ... + a2x2 + a1x1 + a0x0
The highest exponent, k, is called the degree of the polynomial, and the real number constants a0, a1, ... are the coefficients of the polynomial. A class to represent polynomials can be created by using a dynamic array to hold the coefficients.
Operations on polynomials supported by the class could include:
The String and Bag classes are intended to be general, frequently used, utility classes. They must have a variety of general purpose public member functions and overloaded operators.
The Geometry3D library is intended to be a special purpose tool kit for construction of virtual 3D spaces. Geometric objects are composed by making copies of the objects passed to their constructors. The library must also have a full complement of general purpose member functions and overloaded operators.
The Bonsai example illustrates a custom object model created for a special purpose. Bonsai classes are used for keeping track of real-world configurations (an object database). It can answer questions like "which tree is in which pot?" and "What trees are part of this bonsai?" A bonsai object is constructed by keeping pointers to existing tree and pot objects, not by making copies of them.