// C++ inheritance example
// By Ben 02/10/2018

#include <iostream>
using namespace std;

class Shape{
public:
	//Set shapes width and height
	void SetSize(int w, int h){
		width = w;
		height = h;
	}
protected:
	int width;
	int height;
};

//Create a rectangle class that uses parts from the base class Shape.
class Rectangle : public Shape{
public:
	//Public member
	int Area(){
		//Calk the width and height values from the base class Shape.
		return width*height;
	}
};

int main(){

	Rectangle Rect;
	//Access SetSize from the Shape class
	Rect.SetSize(6, 8);
	//Display the area of the rectangle.
	std::cout << "Area = " << Rect.Area() << endl;

	system("pause");
	return 0;
}