1 Horizontal Pairings
2 Boss Chains

Lab 5, CSC 102, Spring 2012

Put all of the tests and examples of data for this lab in a class called Lab4. You may name your package whatever you like :).

1 Horizontal Pairings

In addition to the prior two kinds of data, a HorizPair represents a horizontal pairing of displayed objects. It should therefore be a Displayed, and should contain two Displayed’s, left and right.

Formulate two examples of the HorizPair type, including one containing at least four individual elements.

You will also need to implement the methods that already exist on the hierarchy. For a Horizontal pair, the width should be the sum of the two widths. Conversion to text is accomplished simply by appending strings, with a space in between. The resulting color and point size should be taken from the result of the conversion on the left element. A Horizontal pair is good for kids if both of its elements are good for kids.

2 Boss Chains

An Employee is either a Boss, containing a name, or an Underling, containing a name and a supervisor (another Employee).

Formulate two examples of the data, including at least one containing four people total.