#include <iostream>
using namespace std;

class Robot{
	public:
		float getX(){return locX;}
		float getY(){return locY;}
		float getFacing(){return facing;}
		void setFacing(float f){facing=f;}
		void setLocation(float x,float y);
	private:
		float locX;
		float locY;
		float facing;
};

void Robot::setLocation(float x, float y){
	if(x<0.0||y<0.0){
		cout<<"Error! Illegal location!!"<<endl;
	} else{
		locX=x;
		locY=y;
	}
}

int main(){
	Robot r1;
	r1.setLocation(10.5,20.0);
	cout<<"Robot 1 is in X: "<<r1.getX()<<" and Y: "<<r1.getY()<<endl;
	Robot *r2=new Robot();
	r2->setLocation(50.0,100.0);
	cout<<"Robot 2 is in X: "<< r2->getX()<<" and Y: "<< r2->getY()<<endl;
	delete r2;
	return 0;
}
