255.阅读下列说明和C++代码,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。
【说明】
以下C++代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分类及其关系如图6-1所示。
【C++代码】
#include?#include?using?namespace?std;class?DrawCircle?{??????//绘制圆形,抽象类? ? ? public: (1);//定义参数为?int?radius,?int?x,?inty? ?virtual~DrawCircle()?{?}};class?RedCircle:public?DrawCircle?{????//绘制红色圆形? ? ? ? public: void?drawCircle(intradius,?int?x,?int?y)?{cout?<<?"Drawing?Circle[red,radius:<<radius;? ? ? ? ? ? ? cout?<<?",x:?"?<<x<<?",y:"<<y<<?"]"?<<?end1;? ?}};class?GreenCircle:public?DrawCircle?{????//绘制绿色圆形? ? ? public:? ?void?drawCircle(int?radius,?int?x,?int?y)?{ cout?<<"Drawing?Circle[green,radius:?"<<?radius;? ? ? ? ? ? ? ? ? ? ? ?cout?<<",x:?"?<<x<<?",y:?"<<y<<?"]"?<<?end1;? }};class?Shape?{????//形状,抽象类? ? ? protected:? (2);? ? ? public:? ?Shape(DrawCircle*drawCircle)?{? this?->?drawCircle?=?drawCircle;? }? ?virtual~shape()?{?}? public:? ?virtual?void?draw()?=?0;};class?Circle:public?Shape?{????//圆形? ? private:? ? ?int?x,y,radius;? ? public:? Circle(int?x,inty,int?radius,DrawCircle?*drawCircle)? (3)? {? this->x?=?x;? ?this->y?=?y;? ? this->radius?=?radius; }? ? ? public:? void?draw(){? drawCircle?-> (4); }};int?main(){Shape?*redCirclenew?Circle(100,100,10,????(5)????);//绘制红色圆形? Shape?*greenCircle=new?Circle(100,100,10, (6)??);//绘制绿色圆形redCircle >draw();? ?greenCircle?->draw();? ?return?0;}