问题 听力题

第二卷

I. 单词拼写。根据汉语或首字母的提示写出单词,使句子完整与正确。(一词一空,共10小题,计10分)

1. You are quite right. We t__________ agree with your opinion.

2. I dislike him personally, but I a_________ his art.

3. Sea water c__________ many kinds of mineral(矿物质), including salt.

4. The farmer was in danger because he was b________ by a snake this morning.

5. It is said that the band will come here to give a p_________ at the concert for the children.

6. Robots are gradually ______( 代替 ) humans in many factories in Japan.

7. The first day of _________(八月) is Army Day in China.

8. The policemen asked the two _______(过路人) about the traffic accident.

9. Sanya is so ____(诱人的) in winter that a large number of visitors come to spend their holiday.

10. Nowadays many students use ____________(电子的) dictionaries to look up new words .

答案

1.totally  2。Appreciate   3.contains   4.bitten  5.performance   6.replacing   7.august    8.passers-by   9.attractive    10.electronic  

单项选择题
填空题

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

[说明]

现欲构造一棵文件/目录树,采用组合(Composite)设计模式来设计,得到的类图如图18-20所示。

[Java代码]

import Java.util.ArrayList;

import Java.util.List;

(1) class AbstractFile

protected String name;

public void printName()System.out.printin(name);

public abstract boolean addChild(AbstractFile file);

public abstract boolean removeChild(AbstractFile file);

public abstract List<AbstractFile>getChildren();

class File extends AbstractFile

public File(String name)this.name=name;

public boolean addChild(AbstractFile file)return false;

public boolean removeChild(AbstractFile file) return false;

public List<AbstractFile>getChildren()return (1)

class Foider extends AbstractFiie

private List<AbstractFile>childList;

public Folder(String name)

this.name=name;

this.childList=new ArrayList<AbstractFile>();

public boolean addChild(AbstractFile file) return childList.add(file);

public boolean removeChild(AbstractFile file) return childList.remove(file);

public (3) <AbstractFile>getChildren()return (4)

public class Client

public static void main(String[]args)

//构造一个树形的文件/目录结构

AbstractFile rootFoider=new Foider("C:\\");

AbstractFile compositeFolder=new Folder("composite");

AbstractFile windowsFoider=new Foider("windows");

AbstractFile file=new File("TeStCompoSite.java");

rootFolder.addChild(compositeFoider);

rootFoider.addChild(windowsFolder);

compositeFolder.addChild(file);

//打印目录文件树

printTree(rootFolder);

private static void printTree(AbstractFile ifile)

ifile.printName();

List<AbstractFile>children=ifile.getChildren();

if(children==null) return;

for(AbstractFile file:children)

(5)

该程序运行后输出结果为:

C:\

composite

TestComposite.java

Windows

(5)处填()。