Guided Practice 1.2

Here is an example based on Exercise 94 from HtDP/2e:

Design a data representation for the following four kinds of zoo animals:

Write a data definition for ZooAnimal. Be sure to include:

  1. Structure Definitions
  2. Constructor Template
  3. Interpretation
  4. Observer Template
  5. Examples

Here is a solution. But remember, no peeking! You won't get anything out of this exercise if you don't write down your solution first.


Last modified: Mon Jul 25 23:32:37 Eastern Daylight Time 2016