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

题型:填空题

问题:

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

[说明]

已知某类库开发商提供了一套类库,类库中定义了Application类和Document类,它们之间的关系如图18-15所示,其中,Application类表示应用程序自身,而Document类则表示应用程序打开的文档。Application类负责打开一个已有的以外部形式存储的文档,比如一个文件,一旦从该文件中读出信息后,它就由一个Document对象表示。

当开发一个具体的应用程序时,开发者需要分别创建自己的Application和Document子类,例如图18-15中的类MyApplication和类MyDocument,并分别实现Application类和Document类中的某些方法。

已知Application类中的openDocument()方法采用了模板方法(Template Method)设计模式,该方法定义了打开文档的每一个主要步骤,如下所示。

(1)检查文档是否能够被打开,若不能打开,则给出出错信息并返回。

(2)创建文档对象。

(3)通过文档对象打开文档。

(4)通过文档对象读取文档信息。

(5)将文档对象加入到Application的文档对象集合中。

[C++代码]

#include<iostream>

#include<vector>

using namespace std;

C1ass Document

public:

void save()/*存储文档数据,此处代码省略*/

void open(string docName) /*打开文档,此处代码省略*/

void close() /*关闭文档,此处代码省略*/

virtual void read(String docName)=0;

class Appplication

private:

vector< (1) >docs; /*文档对象集合*/

public:

bool canopenDocument(String docName)

/*判断是否可以打开指定文档,返回真值时表示可以打开返回假时值表示不可打开,此处代码省略*/

void addDocument(Document *aD0cument)

/*将文档对象添加到文档对象集合中*/

docs.push_back( (2) );

virtual Document *doCreateDocument()=0;/*创建一个文档对象*/

void openDocument(string docName)/*打开文档*/

if( (3) )

cout<<"文档无法打开!"<<end1;

return;

(4) adoc= (5)

(6)

(7)

(8)

(8)处填()。

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

此题要求改正所给句中的错误。每题只有一个错误,按下列情况改正:

此句多一个词:把多余的词用斜线(\)划掉,在该句右边横线上写出该词,并也用斜线划掉。  

此句缺一个词:在缺词处加一个漏字符号(∧),在该句右边横线上写出该加的词。

此句错一个词:在错的词下划一横线,在该句右边横线上写出改正后的词。

小题1:His father has never been to Europe. He hasn’t been there, too.

小题2:Although he failed again, he would not lose his heart.

小题3:I’m sorry. I know only a few English.

小题4:In a rainy night, he came back home alone.

小题5:Australia, an European country, is famous for its music

小题6:We’ll never forget the days when we spent on the beach.

小题7:It mustn’t have rained just now, for the ground is dry.

小题8:The story of his success was so inspired that we were all determined to work harder to achieve our goals.

小题9:When he was in the twenties, he went to America for his further study.

小题10:Only in this way you be able to solve the problem.

题型:填空题

肿势平坦,皮色不红不热,或微红微热,大按之乃痛而应指者为:()

A.有脓

B.无脓

C.脓已成熟

D.脓浅

E.脓深

题型:填空题

脊髓空洞症与髓内肿瘤的鉴别要点是,前者()

A.节段性分离性感觉障碍

B.病情进展较慢

C.皮肤及关节营养障碍

D.尿便障碍、瘫痪及椎管梗阻早期出现

E.脊髓MRI检查可显示空洞

题型:填空题

线密度

题型:填空题

《公民道德建设实施纲领》要求大力倡导以爱岗敬业、诚实守信、办事公道、服务群众,奉献社会为主要内容的职业道德。()

更多题库