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




import extensions;
 
class Point
{
    prop int X;
    prop int Y;
 
    constructor new(int x, int y)
    {
        X := x;
        Y := y
    }
 
    constructor new()
        <= new(0,0);
 
    print() { console.printLine("Point") }        
}
 
class Circle : Point
{
    prop int R;
 
    constructor new()
        <= new(0);
 
    constructor new(int r)
        <= new(0, 0, r);
 
    constructor new(int x, int y, int r)
        <= new(x, y)
    {
        R := r
    }
 
    print() { console.printLine("Circle") }
}
 
public program()
{
    Point p := Point.new();
    Point c := Circle.new();
 
    p.print();
    c.print()
}