问题 单项选择题

带有虚基类的多层次派生类构造函数的成员初始化列表中都要列出虚基类的构造函数,这样对虚基类的子对象初始化

A.与虚基类下面的派生类个数有关

B.多次

C.二次

D.一次

答案

参考答案:D

解析: 本题考核虚基类以及构造函数。使用虚基类解决二义性问题的关键是在派生类中只产生一个虚基类对象。虚基类子对象由最派生类的构造函数通过调用虚基类的构造函数进行初始化(最派生类的构造函数的成员初始化列表中必须列出对虚基类构造函数的调用,否则,表示使用该虚基类的缺省构造函数)。由于最派生类总是相对,因此,从虚基类直接或间接派生的派生类中的构造函数的成员初始化列表中都要列出对虚基类构造函数的调用。但只有用于建立对象的最派生类的构造函数才调用虚基类的构造函数,此时最派生类的所有基类中列出的对虚基类的构造函数的调用在执行过程中都被忽略,从而保证对虚基类子对象只初始化一次。

阅读理解

One of the world's richest men has taken a close interest in one of man's most basic functions: visiting the toilet.Bill Gates’ charitable organization, the Bill and Melinda Gates Foundation, is looking for inventors to design the loo of the future, which, they hope, would improve sanitation for millions of people around the world.

So, what's wrong with the traditional flush toilet? Firstly, it wastes a huge amount of potential drinking water.Secondly, they are more likely to cause pollution.This is a real problem in many areas of the developing world, where, according to United Nations’ estimates, unsafe sanitation causes half of all hospitalizations.Younger people are particularly at risk.Illnesses which cause diarrhea are responsible for the deaths of about 1.5 million children a year.Finally, standard lavatories simply aren't practical in remote areas.

The challenge set by Bill Gates was to come up with a latrine which works without running water, electricity or aseptic tank.It also needed to operate for less than 5 cents.28 designs were displayed at the recent event of the Toilet Fair in Seattle, USA.Among them was one which turned human waste into electricity using microwaves, another which converted human waste into charcoal, and yet another which used urine for flushing.

But the winner was a solar-powered design which generated hydrogen gas and electricity.The team from the California Institute of Technology(CIT)picked up a prize of $ 100,000.

But clearly Bill Gates doesn't feel he's flushing money down the toilet.After the Seattle event he said, "We couldn't be happier with the response we've gotten," Gates has even promised $370 million more to the future toilet project.They hope to field test more prototypes over the next three years.

小题1:Why is Bill Gates paying people to invent new toilets?

A.Because he wants to test people's sense of creativity.

B.Because he wants to improve sanitation for many people.

C.Because he thinks the traditional ones are out of fashion.

D.Because he can't design this kind of things himself.小题2:Which of the following is NOT a problem with the traditional flush toilet?

A.They waste too much water.

B.They might cause diseases.

C.They are not always practical.

D.They are too complicated to use.小题3:The underlined word "latrine" in the third paragraph might have similar meanings to the word "__   " in the text.

A.loo

B.sanitation

C.diarrhea

D.prototype小题4:The team from CIT won the prize because their design        .

A.can change human waste into electricity

B.can turn human waste into charcoal

C.can produce power with solar energy

D.can use urine for flushing小题5:If people "flush money down the toilet", they are       .

A.showing off their wealth

B.angry with their working conditions

C.wasting money for nothing

D.expressing their great determination

单项选择题