/* ******************************************************* * Class design exercises: * ******************************************************* * The first thing we will work on in this lab is design * of self-referential classes. * * Keep this file open when you start the next one, as * we'll be reusing one of these designs. * *******************************************************/ /* ******************************************************* * Class design exercise 1: A list of weather events. * In the space below, design a class hierarchy to * represent lists of weather events (statistics about * weather at a particular point in time). * * A (single) weather event consists of: * - a description string * - degrees Fahrenheit (allows decimal places) * - inches of precipitation (allows decimal places) * - day of the year (a number from 1 to 365) * *******************************************************/ /* ******************************************************* * Class design exercise 2: A bank vault. * In the space below, design a class hierarchy to * represent money kept in a bank vault. * * A bank vault is either a stack of dollar bills (keep * track of how many), or a safe containing another bank * vault. The only important information about a safe * is what it contains. * *******************************************************/ /* ******************************************************* * Class design exercise 3: A family tree. * In the space below, design a class hierarchy to * represent a family tree. * * A family tree consists of relatives. Some relatives * are known - these are family members, and each has * a name, a gender, a year of birth, and a mother * and father. Everyone else is a long lost relative - * nothing is known about them but their place in the * family tree. * *******************************************************/