#include <iostream>
using std::cout;
using std::endl;
class Area {
public:
double height;
double width;
};
class Rectangle : public Area {
public:
Rectangle(double h, double w) {
height = h;
width = w;
}
double area() {
return height * width;
}
};
class IsoscelesTriangle : public Area {
public:
IsoscelesTriangle(double h, double w) {
height = h;
width = w;
}
double area() {
return 0.5 * width * height;
}
};
int main()
{
Rectangle o1(13, 7.0);
IsoscelesTriangle o2(3, 9);
cout << o1.area() << endl;
cout << o2.area() << endl;
return 0;
}
/*
run:
91
13.5
*/