使用VC++6.0打开考生文件夹下的源程序文件3.cpp。类People包括姓名和年

题型:填空题

问题:

使用VC++6.0打开考生文件夹下的源程序文件3.cpp。类People包括姓名和年龄两个字段。函数fun获得年龄比较大的人的姓名,然后输出这个姓名到屏幕。
其中定义的类并不完整,按要求完成下列操作,将类的定义补充完整。
(1)完成类的构造函数功能,请在注释1后添加适当的语句。
(2)完成构造函数对姓名的赋值,请在注释2后添加适当的语句。
(3)定义类的友元函数fun,请在注释3后添加适当的语句。
(4)补充函数fun的年龄比较功能,请在注释4后添加适当的语句。
注意:增加或者修改代码的位置已经用符号表示出来,请不要修改其他的程序代码。
试题程序:
#include<iostream.h>
class People

public:
//********1********

int i;
for(i=0;sUserName[i]!=0;i++)
m_UserName[i]=sUserName[i];

//********2********
m_Old=nOld;

private:
char m_UserName[32];
int m_Old;
//********3********

void fun(char *s,People& person1,People&person2)

//********4********
if()

for(int i=0;person1.m_UserNamd[i]!=0;i++)

s[i]=person1.m_UserName[i];
s[i+1]=0;


else

for(int i=0;person2.m_UserName[i]!=0;i++)
s[i]=person2.m_UserName[i];
s[i+1]=0;



void main()

char s[32];
People p1("abc",20);
People p2("def",30);
fun(s,p1,p2);
cout<<s<<end1;
return;

考点:计算机等级考试C++二级C++机试
题型:填空题

阅读理解。

     We all need to exercise. Doctors say it is good for us. It makes your heart and body strong. It also

gives you more energy. And you will feel better about yourself. It's best to exercise twice a week.

Twenty minutes each time is enough.

     There are many ways to exercise. You can walk, run, play sports, or swim. Many people go to

special places to exercise.

     They are ca1led"fitness centers." These places have a lot of equipment. Some People buy equipment

for their homes. But it is very expensive.

     Exercising can be fun. Friends can exercise together at a fitness center. Or, they can play sports

together. How do you exercise?

1. What is the main idea? [ ]

A. Exercise equipment is expensive.

B. Playing sports is a good way to exercise.

C. Every person shou1d exercise.

2. We should exercise _____. [ ]

A. every day

B. 20 minutes a week

C. twice a week

3. At fitness centers, _____. [ ]

A. you can buy expensive equipment

B. people can do many kinds of exercising

C. it is very expensive

4. Which of these kinds of exercising is not in the article? [ ]

A. Dancing.

B. Swimming.

C. Sports.

5. Which of these sentences about exercising is true? [ ]

A. Exercising is expensive.

B. Exercise is good for your heart.

C. Only doctors exercise.

题型:填空题

在建设工程文件档案管理职责中,负有收集和整理工程准备阶段竣工验收阶段形成的文件,并进行立卷档职责的是( )。

A.施工单位

B.监理单位

C.建设单位

D.设计单位

题型:填空题

血小板减少见于

A.溶血性贫血

B.急性出血

C.急性中毒

D.脾切除后

E.再障性贫血

题型:填空题

属于非细胞型微生物的是()

A.真菌

B.病毒

C.支原体

D.螺旋体

E.衣原体

题型:填空题

地面电源正在向左右发电机汇流条供电;当APU起动好后,将APU发电机右边的电门接通:().

A、左、右发电机汇流条仍保留由地面电源供电

B、左发电机汇流条断开供电,右发电机汇流条由APU供电

C、左发电机汇流条仍保留由地面电源供电,右发电机汇流条转换到由APU发电机供电

D、左右发电机汇流条都转换到由APU供电

更多题库