问题 阅读理解

阅读理解。

     Mails, games, music, news, chat rooms and shopping! The Internet is part of the way we live today. It's

easy to get onto the Internet. The only thing we need to do is to use a modem (调制解调器) which is used for

connecting a computer to a telephone line. The Internet is changing and growing all the time. More and more

people have computers and use the Internet. Using the Internet means surfing the World Wide Web(That's the

'www' you always hear about.). The Web has large numbers of websites in it. They are the places you go to

get information and do things.

     Where do these websites come from? They are made by web designers (设计师). What happens when you

click on a word or a picture? You are sent to another page. It's all because of the web designer. Web designers

do a lot of work by using a computer programming language.

     Is web design all about computer programming? No. It's about making something new. Web designers must

imagine a lot when they are making a website. It must look good and be fun to use. A big part of Web design is

art. They choose the best pictures and colors to make the web site look good. They also write the things that

you see on the website. An important part of their job is to share ideas with the website manager about how to

design the website well.

1. This passage is mainly about ________.

A. computer programming language

B. the web designers' work

C. the website manager's work

D. the way to get onto the Internet

2. More and more people are using the Internet because it's ________.

A. easy and useful

B. beautiful and funny

C. colourful and hopeful

D. changing and growing

3. It's possible for us to change websites by just a click because of ________.

A. the modem's help

B. the telephone line's help

C. the web designers' work

D. the website manager's work

4. The web designers do a lot of work except _________.

A. making the websites new and beautiful

B. writing things on the Internet

C. doing the computer programming

D. following the manager's ideas.

答案

1-4: BACD

问答题


阅读以下说明和C++代码,将应填入(n)处的字句写在对应栏内。
【说明】
某网络游戏存在战士(Fighter)、野蛮人(Savage)、白法师(White Witch)三种角色,它们具有Role接口,角色的类图关系如图1.1所示。现要将黑法师(BlackWitch)角色加入此网络游戏以实现功能扩充。已知某第三方库已经提供了法师(Witch)类,且完全满足系统新增的黑法师角色所需的功能,但法师 (Witch)不是由Role派生而来,它提供的接口不能被系统直接使用。代码8-1既使用了法师(Witch),又遵循了Role规定的接口,既避免了从头开发一个新的黑法师类,又可以不修改游戏中已经定义的接口。代码8-2根据用户指定的参数生成特定的角色实例,并对之进行显示操作。
游戏中定义的接口与黑法师(BlackWitch)提供的显示接口及其功能见表1.1。


图片1.1 角色的类图关系
表1.1

Roke BlackWitch功能
display()displayIt()显示角色
【代码8-1】
class BlackWitch: public (1) {
private:
(2) m_BlackWitch;
public:
void display( ) {
m_BlaekWitch. (3) ;
} };
【代码8-2】
class Factory {
public:
(4) getRolelnstance( int type){ //生成特定类实例
switch (type) {
case 0: return new Fighter;
case 1: return new Savage;
case 2: return new WhiteWitch;
case 3: return new BlackWitch;
default: return NULL;
}
}
};
void main(int arge,ehar * argv[ ] ) {
if(arge ! =2){
cout < < "error parameters !" < < end1;
return;
}
int type = atoi(argv[ 1 ] );
Factory factory;
Role * s;
s = factory. (5) ;
if(s = = NULL) {
cout < < "Error get the instance !" < < end1;
return;
}
s-- > display( );
delete s;
return;
}

问答题 简答题