## 21.2 Polymorphic Variables - Dynamic Binding (cont.)

- Print out information regarding each employee:

  >     for (int i = 0; i < department.size(); i++)
  >     {
  >        cout << "Employee: "
  >           << department[i]->get_name() << " income "
  >           << department[i]->annual_income() << "\n";
  >     }

- Different `annual_income`s are being called:

  > `Employee Sarah Smith income 69000
  > Employee Lisa Lim income 36000
  > Employee Harry Hacker income 42000`

prev |top |next