阅读下列说明和C++代码,将应填入 (n) 处的字句写在对应栏内。[说明]某游戏公司

题型:填空题

问题:

阅读下列说明和C++代码,将应填入 (n) 处的字句写在对应栏内。

[说明]

某游戏公司现欲开发一款面向儿童的模拟游戏,该游戏主要模拟现实世界中各种鸭子的发声特征、飞行特征和外观特征。游戏需要模拟的鸭子种类及其特征如表18-4所示。

为支持将来能够模拟更多种类鸭子的特征,采用策略设计模式(Strategy)设计的类图如图18-7所示。

其中,Duck为抽象类,描述了抽象的鸭子,而类RubberDuck、MallardDuck、CottonDuck和RedHeadDuck分别描述具体的鸭子种类,方法fly()、quack()和display()分别表示不同种类的鸭子都具有飞行特征、发声特征和外观特征;类FlyBehavior与QuackBehavior为抽象类,分别用于表示抽象的飞行行为与发声行为;类FlyNoWay与FlyWithWings分别描述不能飞行的行为和用翅膀飞行的行为;类Quack、Squeak与QuackNoWay分别描述发出“嘎嘎”声的行为、发出橡皮与空气摩擦声的行为与不发声的行为。请填补以下C++代码中的空缺。

[C++代码]

#include<iostream>

using namespace (1)

class FlyBehavior

public: (2) fly()=0;

class QuackBehavior

public: (3) quack()=0;

class FlyWithWings:public FlyBehavior

public:void fly()cout<<"使用翅膀飞行!">>end1;

class FlyNoWay:public FlyBehavior

public:void fly()cout"不能飞行!"end1;

class Quack:public QuackBehavior

public:void quack()"cout发出\’嘎嘎\’声!”end1;

classSqueak:publicQuackBehavior

public:voidquack()cout<<"发出空气与橡皮摩擦声!">>end1;

classQuackNoWay:publicQuackBehavior

public:voidquack()cout<<"不能发声!">>end1;

class Duck

protected:

FlyBehavior * (4)

QuackBehavior * (5)

public:

void fly() (6)

void quack() (7) ;;

virtual void display()=0;

class RubberDuck:public Duck

public:

RubberDuck()

flyBehavior=new (8)

quackBehavior=new (9)

RubberDuck()

if(!flyBehavior)delete flyBehavior;

if(!quackBehavior)deletequackBehavior;

void display()/*此处省略显示橡皮鸭的代码*/

//其他代码省略

(6)处填()。

考点:计算机软件水平考试中级软件设计师软件设计师
题型:填空题

A recent poll indicated that half the teenagers in the United States believe that communication between them and their parents is (1) and further that one of the prime causes of this gap is (2) listening behavior. As a(an) (3) in point, one parent believed that her daughter had a severe (4) problem. She was so (5) that she took her to an audiologist to have her ear tested. The audiologist carefully tested both ears and reported back to the parent:"There’s nothing wrong with her hearing. She’s just (6) you out. "

A leading cause of the (7) divorce rate (more than half of all marriages end in divorce) is the failure of husbands and wives to (8) effectively. They don’t listen to each other. Neither person (9) to the actual message sent by the other.

In (10) fashion, political scientists report that a growing number of people believe that their elected and (11) officials are out of (12) with the constituents they are supposedly (13) Why Because they don’t believe that they listen to them. In fact, it seems that sometimes our politicians don’t even listen to themselves. The following is a true story: At a national (14) conference held in Albuquerque some years ago, then Senator Joseph Montoya was (15) a copy of a press release by a press aide shortly before he got up before the audience to (16) a speech. When he rose to speak, (17) the horror of the press aide and the (18) of his audience, Montoya began reading the press release, not his speech. He began, "For immediate release. Senator Joseph M. Montoya, Democrat of New Mexico, last night told the National... " Montoya read the entire six page release, (19) with the statement that he "was repeatedly (20) by applause.

14()

A.legislative

B.legitimate

C.legalized

D.liberal

题型:填空题

下面措施中哪一个是在传播过程中减弱噪声的[ ]

A.做一个外罩将声源罩住

B.在耳孔中塞一团棉花

C.在马路旁植树造林

D.换用噪声小的机器

题型:填空题

把长为10cm的细铁丝截成两段,各自围成一个正方形,求这两个正方形面积之和的最小值。

题型:填空题

从占有者身份看,颐和园属于( )。

A.皇家园林
B.私家园林
C.寺观园林
D.公共游憩园林

题型:填空题

材料在自然状态下单位体积的质量称为密度。( )

更多题库