请使用VC6或使用[答题]菜单打开考生文件夹projl下的工程proj1,其中有枚举

题型:问答题

问题:

请使用VC6或使用[答题]菜单打开考生文件夹projl下的工程proj1,其中有枚举DOGCOLOR、狗类Dog和主函数man的定义。程序中位于每个“//ERROR ****found****”下的语句行有错误,请加以改正。改正后程序的输出结果应该是:
There is a white dog named Hoho.
There is a black dog named Haha.
There is a motley dog named Hihi.
注意:只修改每个“//ERROR ****found****”下的那一行,不要改动程序中的其他内容。
#include <iostream>
using namespace std;
enum DOGCOLOR BLACK,WHITE,YELLOW,BROWN,PIEBALD,OTHER;
class Dog //狗类
DOGCOLOR color;
char name[20];
static int count;
public:
Dog(char name[],DOGCOLOR color)
strcpy(this->name,name);
strcpy(this->color,color);

DOGCOLOR getColor () constreturncolor;
const char* getName () const return * name;
const char * getColorString ()const
switch (color)
case BLACK:return"black";
case WHITE:return"white";
case YELLOW:return"yellow";
case BROWN:return"brown";
case PIEBALD:return"piebald";

return"motley";

void show () const
cout<<"There is a "<<getColorString()<<"dog named"<<name<<’.’<<endl;

;
int main ()
//ERROR **********found**********
Dog dog1("Hoho",WHITE),dog2("Haha",BLACK);dog3("Hihi",OTHER);
dog1.show();
dog2.show();
dog3.show();
return 0;

考点:计算机等级考试C++C++语言笔试
题型:问答题

He made up his mind to devote his life _______ pollution _______ happily.

A.to prevent; to live

B.to prevent; from living

C.to preventing; to live

D.to preventing; living

题型:问答题

花期调控的内因是()。

A、环境因子

B、生长调节剂

C、栽培品种及其生长发育规律

D、修剪

题型:问答题

阵发性房颤的治疗原则是( )。

A.预防复发,发作时控制室率

B.抗凝治疗,发作时控制室率

C.抗凝治疗,发作时转复窦律

D.转复窦律,发作时控制室率

E.预防复发,发作时转复窦律

题型:问答题

出砂井试油管柱完成深度必须在()。

A.油层以上

B.油层中部

C.油层底界

D.油层底界以上

题型:问答题

农民工教育培训工作不属于总承包企业的教育管理体系。

更多题库