#include <iostream>
using namespace std;

class Shape
{
protected:
	int x,y;
public:
	void draw(void);
	void moveTo (int newx, int newy);
};

void Shape::draw ()
{
	cout << "Drawing shape \n";
}

void Shape::moveTo (int newx, int newy)
{
	x = newx;
	y = newy;
}

class Rectangle : public Shape
{
private:
	int width;
	int height;
public:
	//void draw (void);
	void setWidth (int newWidth);
	void setHeight (int newHeight);
	Rectangle (int x, int y, int w, int h);
	~Rectangle(void);
};

//void Rectangle::draw ()
//{
//	cout << "Drawing a Rectangle at (" << x << "," << y<< "), width " << width << ", height " << height << "\n";
//}

void Rectangle::setWidth (int newWidth)
{
	width = newWidth;
}

void Rectangle::setHeight (int newHeight)
{
	height = newHeight;
}

Rectangle::Rectangle (int initx, int inity, int initw, int inith)
{
	x = initx;
	y = inity;
	width = initw;
	height = inith;
}
 
Rectangle::~Rectangle(void)
{
}

class Circle : public Shape
{
private:
	int radius;
public:
	//void draw (void);
	void setRadius (int newRadius);
	Circle (int initx, int inity, int initr);
	~Circle(void);
};

//void Circle::draw (void)
//{
//	cout << "Drawing a Circle at (" << x << "," << y<< "), radius " << radius << "\n";
//}

void Circle::setRadius (int newRadius)
{
	radius = newRadius;
}

Circle::Circle (int initx, int inity, int initr)
{
	x = initx;
	y = inity;
	radius = initr;
}

Circle::~Circle(void)
{
}

void main (void)
{
	int height, width, radius, x, y, reply;
    Rectangle rct(10, 20, 5, 6);
    Circle cle (15, 25, 8);
	rct.draw();
	cle.draw();
	do
	{
		cout << "1. resize rectangle \n";
		cout << "2. resize circle \n";
		cout << "3. reposition rectangle \n";
		cout << "4. reposition circle \n";
		cout << "5. exit program \n";
		cout << "Enter number corresponding to choice : ";
		cin >> reply;
		switch (reply)
		{
			case 1:		cout << "Enter width : ";
						cin >> width;
						cout << "Enter height : ";
						cin >> height;
						rct.setWidth(width);
						rct.setHeight(height);
						rct.draw();
						break;
			case 2:		cout << "Enter radius : ";
						cin >> radius;
						cle.setRadius(radius);
						cle.draw();
						break;
			case 3:		cout << "Enter new x coordinate : ";
						cin >> x;
						cout << "Enter new y coordinate : ";
						cin >> y;
						rct.moveTo(x,y);
						rct.draw();
						break;
			case 4:		cout << "Enter new x coordinate : ";
						cin >> x;
						cout << "Enter new y coordinate : ";
						cin >> y;
						cle.moveTo(x,y);
						cle.draw();
						break;
			case 5:		cout << "Exiting program \n ";
						break;
			default: cout<< "Incorrect choice \n";
		}
	}
	while(reply < 5);


	
}
