Task

Create two classes   Point(x,y)   and   Circle(x,y,r)   with a polymorphic function print, accessors for (x,y,r), copy constructor, assignment and destructor and every possible default constructors




uses objectclass;
define :class Point;
    slot x = 0;
    slot y = 0;
enddefine;
 
define :class Circle;
    slot x = 0;
    slot y = 0;
    slot r = 1;
enddefine;
 
define :method print(p : Point);
    printf('Point(' >< x(p) >< ', ' >< y(p) >< ')\n');
enddefine;
 
define :method print(p : Circle);
    printf('Circle(' >< x(p) >< ', ' >< y(p) >< ', ' >< r(p) >< ')\n');
enddefine;