The Driver Program: Lab9.cpp

Lab9.cpp should contain the code that will actually do the late binding and test the implementation of virtual functions. You will be given a skeleton of the main() function in Lab9.cpp`. The skeleton creates a pointer to the base class (i.e. a Shape class pointer). It also creates a Rectangle and a Triangle object. You need to write the code that performs dynamic binding:

  1. Make the base class pointer point to the Rectangle object (You can use '&' to get the object's address)
  2. Invoke the functions for area and draw, e.g. ptr->GetArea(), and verify that you are getting the expected results.
  3. Repeat steps 1 and 2 for a Triangle object.