At home exercise:
Working for a vet clinic, we need to model pets. The clinic cares about the following: type of animal, age, has-had-shots?, chases-vets?. Follow all appropriate steps of the design recipe.
  1. make a structure for pets
  2. make some examples (perhaps giving it a name, perhaps not)
  3. write an expression that extracts whether the pet has had its shots?
  4. write a function needs-shots?, which returns true exactly when the pet is older than 1yr, and hasn't already had its shots.
  5. write a program pet-whoopie, which takes in two pets, and returns a new pet of age 0 w/o shots; the pet's type is the same as the first parameter's pet-type.
  6. write a program age-pet: it takes in a pet, and returns a pet of the same type which is a year older.
    Note: calling age-pet or pet-whoopie does not change any existing pets, no more than calling + changes the numbers it receives. These functions return new pets.


Reminder of the Design Recipe:
  1. data analaysis (how will you represent the problem?)
  2. examples of data (sample inputs)
  3. contract, purpose, header
  4. develop examples of functions (use the sample inputs)
  5. write the body.
  6. test
Note that if different problems both involve the same answer to some parts, you don't need to repeat them. (E.g., the last two programs both have the same data-representation of a pet, and the same examples of the data will suffice)