To give you practice creating and working with classes and derivation.
Dinosaurs have several basic characteristics: a species name, height and weight, movement speed, and diet. They also have several basic behaviors: eating, moving, and sleeping.
Your assignment is to define and implement a generic Dinosaur class that defines these characteristics and behaviors. The behaviors can be very basic, just printing out a line saying something like "sleeps." Declare all member fields as private, and make sure that you have accessor functions for all of the member fields.
Use the Dinosaur class as a base class and make classes to represent the following:
Apatosaurus (a very large, herbivorous, slow-moving dinosaur)
Tyrannosaurus Rex (a large, carnivorous, fast dinosaur)
Hadrosaur (a medium-sized, herbivorous, fast dinosaur)
For each of these classes, come up with at least two additional pieces of information about that specific dinosaur type (eg, for a Tyrannosaurus, you might have the number of teeth the particular Tyrannosaur has). Also, customize at least one of the sleeping/eating/moving behaviors for each class as appropriate. You can make up any details you want if you don’t want to bother looking up information about dinosaurs.
Once you have these classes, write a small program that:
Creates one of each kind of dinosaur object
Have each one go through its behaviors
Source: Windows Questions C++