【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc

上传人:jobexamine331 文档编号:1329634 上传时间:2019-10-17 格式:DOC 页数:13 大小:85.50KB
下载 相关 举报
【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc_第1页
第1页 / 共13页
【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc_第2页
第2页 / 共13页
【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc_第3页
第3页 / 共13页
【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc_第4页
第4页 / 共13页
【计算机类职业资格】全国计算机等级考试二级C++真题2009年9月及答案解析.doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、全国计算机等级考试二级 C+真题 2009年 9月及答案解析(总分:100.00,做题时间:90 分钟)一、选择题(每小题 2分,共 70分)(总题数:35,分数:70.00)1.下列数据结构中,属于非线性结构的是 (分数:2.00)A.循环队列B.带链队列C.二叉树D.带链栈2.下列数据结构中,能够按照“先进后出”原则存取数据的是 (分数:2.00)A.循环队列B.栈C.队列D.二叉树3.对于循环队列,下列叙述中正确的是 (分数:2.00)A.队头指针是固定不变的B.队头指针一定大于队尾指针C.队头指针一定小于队尾指针D.队头指针可以大于队尾指针,也可以小于队尾指针4.算法的空间复杂度是指

2、分数:2.00)A.算法在执行过程中所需要的计算机存储空间B.算法所处理的数据量C.算法程序中的语句或指令条数D.算法在执行过程中所需要的临时工作单元数5.软件设计中划分模块的一个准则是 (分数:2.00)A.低内聚低耦合B.高内聚低耦合C.低内聚高耦合D.高内聚高耦合6.下列选项中不属于结构化程序设计原则的是 (分数:2.00)A.可封装B.自顶向下C.模块化D.逐步求精7.软件详细设计产生的图如下: (分数:2.00)A.N-S图B.PAD图C.程序流程图D.E-R图8.数据库管理系统是 (分数:2.00)A.操作系统的一部分B.在操作系统支持下的系统软件C.一种编译系统D.一种操作系统

3、9.在 E-R图中,用来表示实体联系的图形是 (分数:2.00)A.椭圆图B.矩形C.菱形D.三角形10.有三个关系 R,S 和 T如下: (分数:2.00)A.选择B.投影C.交D.并11.已知函数 FA调用 FB,若要把这两个函数定义在同一个文件中,则 (分数:2.00)A.FA必须定义在 FB之前B.FB必须定义在 FA之前C.若 FA定义在 FB之后,则 FA的原型必须出现在 FB的定义之前D.若 FB定义在 FA之后,则 FB的原型必须出现在 FA的定义之前12.有如下两个类定义 class AA; class BB AA v1,*v2; BB v3; Int *v4; ;其中有一个

4、成员变量的定义是错误的,这个变量是 (分数:2.00)A.v1B.v2C.v3D.v413.有如下类定义: class XX int xdata; public: XX(int n=0) : xdata (n) ;class YY : public XX int ydata; public: YY(int m=0, int n=0) : XX(m), ydata(n) ; YY 类的对象包含的数据成员的个数是 (分数:2.00)A.1B.2C.3D.414.下列有关运算符函数的描述中,错误的是 (分数:2.00)A.运算符函数的名称总是以 operator为前缀B.运算符函数的参数可以是对象C

5、运算符函数只能定义为类的成员函数D.在表达式中使用重载的运算符相当于调用运算符重载函数15.下列关于模板形参的描述中,错误的是 (分数:2.00)A.模板形参表必须在关键字 template之后B.模板形参表必须用括弧( )括起来C.可以用 class修饰模板形参D.可以用 typename修饰模板形参16.在下列枚举符号中,用来表示“相对于当前位置”文件定位方式的是 (分数:2.00)A.ios_base:curB.ios_base:begC.ios_base:outD.ios_base:end17.下列字符串可以用作 C+标识符的是 (分数:2.00)A.2009varB.gotoC.t

6、est - 2009D._12318.下列枚举类型的定义中,包含枚举值 3的是 (分数:2.00)A.enum test RED, YELLOW, BLUE, BLACK;B.enum test RED, YELLOW=4, BLUE, BLACK;C.enum test RED=-1, YELLOW,BLUE, BLACK;D.enum test RED, YELLOW=6, BLUE, BLACK;19.有如下程序段: int i=1; while (1) i+; if(i = 10) break; if(i%2 = 0) cout A表达式可输出字符 AB.eof()函数可以检测是否到达

7、文件尾C.对磁盘文件进行流操作时,必须包含头文件 fstreamD.以 ios_base:out模式打开的文件不存在时,将自动建立一个新文件27.有如下程序: #include using namespace std; class Toy public: Toy(char* _n) strcpy (name,_n); count+; Toy() count-; char* GetName() return name; static int getCount() return count; private: char name10; static int count; ; int Toy:cou

8、nt=0; int mail() Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”); coutname,name); const char * getName()const return name; virtual const char * getType()const return “未知类型”; ; class Book: public Publication /书类 public: Book(char *name): Publication(name) virtual const char * getType()const return “书“; ;

9、void showPublication( Publication i-=2) coutA表达式可输出字符 A B.eof()函数可以检测是否到达文件尾C.对磁盘文件进行流操作时,必须包含头文件 fstreamD.以 ios_base:out模式打开的文件不存在时,将自动建立一个新文件解析:27.有如下程序: #include using namespace std; class Toy public: Toy(char* _n) strcpy (name,_n); count+; Toy() count-; char* GetName() return name; static int ge

10、tCount() return count; private: char name10; static int count; ; int Toy:count=0; int mail() Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”); coutname,name); const char * getName()const return name; virtual const char * getType()const return “未知类型”; ; class Book: public Publication /书类 public: Book(char

11、name): Publication(name) virtual const char * getType()const return “书“; ; void showPublication( Publication i-=2) coutdata=data;)解析:46.有如下类定义: class Sample public: Sample1; Sample2; Private: Static int date; ; 将静态数据成员 data初始化为 0的语句是 【11】 。 (分数:2.00)填空项 1:_ (正确答案:int Sample:data = 0;)解析:47.“图形”类 Sh

12、ape中定义了纯虚函数 CalArea1,“三角形”类 Triangle继承了类 Shape,请将Triangle类中的 CalArea函数补充完整。 class Shape public: virtual int CalArea2=0; class Triangle: public Shape public: Triangleint s, int h: side(s),height(h) 【12】 return side*height/2 ; private: int side; int height; ; (分数:2.00)填空项 1:_ (正确答案:int CalArea(size,he

13、ight))解析:48.有如下程序: #include using namespace std; class GrandChild public: GrandChild1 strcpy (name,”Unknown”); const char * getName2const return name; virtual char * getAddress3const=0; private: char name20; ; class GrandSon : public GrandChild public: GrandSonchar *name Char * getAddress4 const ret

14、urn “Shanghai”; ; int main5 GrandChild *gs=new GrandSon(“Feifei”); coutgetName6”住在”getAddress7 【13】 。 (分数:2.00)填空项 1:_ (正确答案:Unknown 住在 Shanghai)解析:49.如下程序定义了“单词”类 word,类中重载了 #include using namespace std; class Word public: Word(string s) : str(s) string getStr1 return str; 【14】 const return (str (ostream Coutw1w2填空项 1:_ (正确答案:bool operator (Word w))解析:50.请将下列模板类 Data补充完整。 template class Data public: void put (T v) val=v; 【15】 get1 /返回数据成员 val的值,返回类型不加转换 return val; private: T val; ; (分数:2.00)填空项 1:_ (正确答案:T)解析:

展开阅读全文
相关资源
猜你喜欢
  • BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf
  • BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf
  • BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf
  • BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf
  • BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf
  • BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf
  • BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf
  • BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf
  • BS ISO 8114-1993 Textile machinery and accessories - Spindles for ring-spinning and doubling machines - List of equivalent terms《纺织机械和附件 环锭纺纱机和并线机用锭子 同义术语表》.pdf BS ISO 8114-1993 Textile machinery and accessories - Spindles for ring-spinning and doubling machines - List of equivalent terms《纺织机械和附件 环锭纺纱机和并线机用锭子 同义术语表》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1