#include #include using namespace std; /* * Shape abstract base class */ class Shape { protected: double base; double height; public: Shape():base(0.0), height(0.0) {} Shape(double base, double height): base(base), height(height) {} void setBase(double base) { this->base = base; } void setHeight(double height) { this->height = height; } double getBase() { return base; } double getHeight() { return height; } virtual double area() = 0; //abstract or pure virtual function }; /* * Derived class (non abstract) with a virtual final function */ class Triangle: public Shape { public: Triangle(): Shape() {} Triangle(double base, double height): Shape(base, height) {} //final can be used only to non-static virtual function virtual double area() override final{ cout<<"Triangle area..."<