#include <iostream>
class ShapeTwoD
{
public:
ShapeTwoD() {}
virtual ~ShapeTwoD() {}
string getName(){return name;}
void setName(string const &newName){name = newName;}
void toString(){}
virtual double computeArea(){return 2+3.0;}
private:
string name;
bool containsWarpSpace;
};
class Square:public ShapeTwoD
{
public:
virtual double computeArea(){return 2+4.0;}
};
using namespace std;
int main()
{
Square s;
s.setName("Sponge");
cout << s.computeArea() << endl; //outputs 5 when i expect it to output 6
}