The farm animal program
- Make an animal interface. It calls for an animal to eat (String parameter,
returns boolean), to make a noise (no parameter, returns a String).
- Create a cat class that implements the animal interface. It can eat "cat
food" and it says "meow".
- Create a horse class that implements the animal interface. It can eat "grain"
and it says "neigh".
- Create a cow class that implements the animal interface. It can eat "hay"
and "straw" and it says "moo".
- Create a bird class that implements the animal interface. Birds "chirp"
and eat "worms" and "insects" and "seeds". Birds
also lay eggs (returns a number, no parameter).
- Create a chicken class that implements the bird class. Chickens do not "chirp",
they "cluck". Everything else is the same as the bird class.
- Create a runner class that tests all of this by making a cat, tiger, cow,
bird and crow. Test their methods.