Lab 6, CSC 102, Spring 2012

To the existing Displayed hierarchy, add the VertPair class, containing two Displayeds. The idea is that the HorizPair objects represent displayed objects that are joined together into a single line of text, whereas the VertPair objects represent sequences of lines of text, joined together vertically.

Extend the width, goodForKids, and convertToText methods to handle VertPairs in a way that’s analogous to HorizPairs. The width of a vertpair is determined by the maximum of its two elements, a vertpair is good for kids if and only if both of its elements are good for kids, and conversion to text is accomplished by joining the Strings representing its two elements with a newline string "\n" in between, using the color and point size of the upper element.

Finally, add the following methods to the entire hierarchy:

In order to figure out whether a String contains another String, refer to the Java API, online at

http://download.oracle.com/javase/6/docs/api/