OOPortal OOPortal

Inheritance/Polymorphism  «Prev  Next»
Lesson 1

Ecological Simulation Program

This module walks you through the design and code of a simple ecological simulation program that is an extension of the predator simulation program used as the course project in Building Classes in C++. In particular, you will look at examples of using an abstract base class and creating an inheritance hierarchy.
You'll examine:
  1. the abstract base class for the lifeforms in the ecological simulation
  2. the lifeform inheritance hierarchy
  3. the lifeform interaction rules
  4. how the simulation is initialized and displayed

At the end of this module, you will have a chance to design and code a more complex version of this simulation program.