问题 单项选择题

下面的描述中表达错误的是

A.公有继承时基类中的public成员在派生类中仍是public的

B.公有继承时基类中的private成员在派生类中仍是private的

C.公有继承时基类中的protected成员在派生类中仍是protected的

D.私有继承时基类中的public成员在派生类中是private的

答案

参考答案:B

解析: C++中,继承方式控制了基类中具有不同访问属性的成员在派生类中的访问属性。基类中的私有成员在派生类中是隐蔽的,只能在基类内部访问。所以B) 选项是错误的。派生类中的成员不能访问基类的中私有成员,但可以访问基类中的公有成员和保护成员。此时派生类对基类中各个成员的访问能力与继承方式无关,但继承方式将影响基类成员在派生类中的访问控制属性,基类中公有和保护成员在派生类中的访问控制属性将随着继承方式而改变:派生类从基类公有继承时,基类的公有成员和保护成员在派生类中仍然是公有成员和保护成员;派生类从基类私有继承时,基类的公有成员和保护成员在派生类中都改变为私有成员;派生类从基类保护继承时,基类的公有成员在派生类中改变为保护成员,基类的保护成员在派生类中仍然为保护成员。所以,A) 、C) 和D) 选项都是正确的。

句型转换

     Brian knew he had been drinking more and more, but he was convinced that he'd return to more

moderate drinking when he wasn't so pressured at work, and that "a few too many drinks now and then"

wasn't a major problem."

     My wife and father were on me to stop drinking, but you know how critical and protective family can

be," said Brian. "So I blew them off."

     It wasn't until his friend Jack spoke up that Brian started to think differently. "That really hit home,

because I wouldn't expect a friend to confront me with something that personal unless it was very

important," said Brian. "

     Jack said he was really concerned about me. He pointed out that my personality changed after I had

a few beers--that I became belligerent(寻衅的). For a normally easy-going guy, that was a dramatic

change in behavior." Jack could see that Brian's numerous drinking binges(放纵) were causing problems. Brian was frequently calling into work sick and falling behind in his work, and his marriage was seriously

on the ropes. Brian was teetering on the edge of disaster. "I didn't want to see a good life and a good

friendship ruined," said Jack, "so I approached Brian, shared my honest observations with him, and

suggested that he seek help."

     After a couple days of soul searching, though still reluctant, Brian took Jack's suggestion and was

assessed by an addiction professional. The expert recommended that Brian check into a treatment center, and one day later Brian did so.

     Many people fear taking the path that Jack took. Speaking up to a friend who may have a problem

with alcohol or other drugs can be a tricky undertaking.

     Yet it's true that a concerned friend can do a lot. Most people don't recognize they have a substance

abuse problem and most don't seek help for a problem until someone close to them intervenes(干预).

1. What happened to Brian according to the passage?

A. He suffered from an illness called alcohol addiction.

B. He changed so much that he was deserted by his family.

C. He became morally corrupted drinking too much all day.

D. He drank a little more than normal to escape the pressure.

2. What does "that" in the 3rd paragraph refer to?

A. Brian's drinking binges.        

B. Jack's talk with Brian.

C. Wife and father's intervention.    

D. Brian's different thoughts.

3.  Brian could accept Jack's suggestions mainly because ____________.  

A. he found his friend was very critical and protective  

B. Jack’s suggestions were professional and persuasive  

C. Jack and Brian's family had different opinions  

D. he knew his friend wouldn't easily intervene his personal affair

4.  Brian's alcohol abuse brought him many problems EXCEPT ____________.  

A. his refusal to listen to his family    

B. his bad temper and aggressiveness  

C. his failure to do his work well      

D. his marriage problems

5. The writer narrates Brian's story in order to ____________.

A. tell us the bad results of alcohol addiction

B. warn us not to fall into the habit of drinking

C. show friends have real power to intervene

D. prove a friend in need is a friend indeed

单项选择题