( 11 )有如下程序:#include<iostream>using namespace std;class Monitor{public:Monitor ( char t ) : type ( t ) {}void print ( ) const{cout<<"The type of monitor is"<<type<<endl;}private:char type;};class Computer{public:Computer ( int i , char c ) : 【 11 】 {}void

题目

( 11 )有如下程序:

#include<iostream>

using namespace std;

class Monitor{

public:

Monitor ( char t ) : type ( t ) {}

void print ( ) const

{cout<<"The type of monitor is"<<type<<endl;}

private:

char type;

};

class Computer{

public:

Computer ( int i , char c ) : 【 11 】 {}

void Print () const

{cout<<"The computer is"<<id<<endl;mon.Print ( ) ; }

private:

int id;

Monitor mon;

};

const Computer myComputer ( 101,'B' ) ;

myComputer .Print ( ) ;

return 0;

}

请将程序补充完整,使程序在运行时输出:

The computer is 101

'The type of monitor i.s 8


相似考题
更多“( 11 )有如下程序:#include&lt;iostream&gt;using namespace std;class Monitor{public:Monitor ”相关问题
  • 第1题:

    标清终端的monitor可以监视几路信号()

    A.8

    B.9

    C.10

    D.11


    参考答案:C

  • 第2题:

    The project schedule is more than a document that lays out the activities over time to represent the time dimension of the project, it is a management tool to be used for decision making. As such , the schedule is used by the project management team to()

    A.Measure, delay, record, distribute, analyze, and direct
    B.Plan, schedule, monitor, control, report, and forecast
    C.Promote, highlight, monitor, control, forecast, and report
    D.Emphasize, visualize, analyze, conceptualize, report and record

    答案:B
    解析:
    项目进度计划不只是一个列出项目规定活动的时间表,而且还是一个用于决策的工具。如:进度计划可以被项目管理团队用来(73)。A.检测,延时,记录,分发,分析和直接B.计划,日程安排,监督,控制,报告和预测C.提升,亮点,监视,控制,预测和报告D.重点化,可视化,分析,概念化,报告和记录

  • 第3题:

    阅读下列说明和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?<?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;}


    答案:
    解析:
    (6)(1)void drawCircle (int radius,int x,int y)
    (2)DrawCircle*drawCircle
    (3)drawcircle
    (4)drawCircle(radius,x,y)
    (5)new RedCircle()
    (6)new GreenCircle()【解析】
    第一空是填接口里面的方法,在接口的实现里面找,可以发现应该填void drawCircle (int radius,int x,int y)。
    第二空可以根据后面this drawCircle=drawCircle判断,这里应该有一个drawCircle属性,因此应该填)DrawCircle drawCircle。
    第三空这里填drawcircle,用-> drawcircle来引用父类的成员。
    第四空调用drawCircle(radius,x,y)方法。
    第五、六空分别创建一个红色圆形对象和一个绿色圆形对象作为Circle里面的实参。

  • 第4题:

    ● A (74) is a device that enables the computer to handle sounds.

    (74)

    A. network card

    B. video card

    C. sound card

    D. monitor


    正确答案:C

  • 第5题:

    You need feedback to 【monitor】 progress.

    A. stop B. achieve C. access D. check

    答案:C
    解析: