#includeiostreamusingnamespacestd;classshape{public:virtualdoublearea()=0;};classRectangle:publicshape{private:doubleW,H;public:Rectangle(doublew,doubleh){W=w;H=h;}doublearea(){returnW*H;}};constPI=3.14159;classCircle:publicshape{private:doubleX,Y,R;public:Circle(doublex,doubley,doubler){X=x;Y=y;R=r;}doublearea(){returnPI*R*R;}};voidmain(){RectangleW(3,5);shape*P;P=&W;coutP-area()endl;CircleC(3,4,5);shape&U=C;coutU.area()endl;}