The Driver Program: Lab11.cpp

Lab11.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 main in Lab11.cpp. Specifically, the skeleton creates a pointer to 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 '&' for getting object's address)
  2. Invoke the functions for area and draw, e.g. ptr->GetArea() and verify that you are getting expected result
  3. Repeat step 1 and 2 for a triangle object.