( 11 )有如下程序:#includeiostreamusing namespace std;class Monitor{public:Monitor ( char t ) : type ( t ) {}void print ( ) const{cout"The type of monitor is"typeendl;}private:char type;};class Computer{public:Computer ( int i , char c ) : 【 11 】 {}void Print () const{cout"The computer is"idendl;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<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
相关考题:
有如下程序: include using namespace std; class Monitor{ public: Monitor(cha 有如下程序:include<iostream>using namespace std;class Monitor{public:Monitor(char t):type(t){ }void Print( )const{cout<<"The type of monitor is"<<type private:char type;};class Computer{public:Computer(int i,char C) :______{}void Print( )const{eout<<"The computer is"<<id<<endl;mort.Print( );}private:int id;Monitor mon;};int main( ){const Computer myComputer(101,'B');myComputer.Print( );return 0;}请将程序补充完整,使程序在运行时输出:The computer is 101The type of monitor is B
A(74)is a device that enables the computer to handle sounds.A.network cardB.video cardC.sound cardD.monitor
A (74) is a device that enables the computer to handle sounds.A.network cardB.video cardC.sound cardD.monitor
● A (74) is a device that enables the computer to handle sounds.(74)A. network cardB. video cardC. sound cardD. monitor
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 directB.Plan, schedule, monitor, control, report, and forecastC.Promote, highlight, monitor, control, forecast, and reportD.Emphasize, visualize, analyze, conceptualize, report and record
阅读下列说明和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;}