2009年9月计算机二级考试C考题

上传人:油条 文档编号:14131379 上传时间:2017-10-27 格式:DOC 页数:13 大小:50.35KB
返回 下载 相关 举报
2009年9月计算机二级考试C考题_第1页
第1页 / 共13页
2009年9月计算机二级考试C考题_第2页
第2页 / 共13页
2009年9月计算机二级考试C考题_第3页
第3页 / 共13页
2009年9月计算机二级考试C考题_第4页
第4页 / 共13页
2009年9月计算机二级考试C考题_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《2009年9月计算机二级考试C考题》由会员分享,可在线阅读,更多相关《2009年9月计算机二级考试C考题(13页珍藏版)》请在金锄头文库上搜索。

1、一、选择题(1)-(10) 、 (21)-(40)每题 2 分, (11)-(20)每题 1 分,共 70 分)(1)下列数据结构中,属于非线性结构的是A)循环队列B)带链队列C)二叉树D)带链栈(2)下列数据结果中,能够按照“先进后出”原则存取数据的是A)循环队列B)栈C)队列D)二叉树(3)对于循环队列,下列叙述中正确的是A)队头指针是固定不变的B)队头指针一定大于队尾指针C)队头指针一定小于队尾指针D)队头指针可以大于队尾指针,也可以小于队尾指针(4)算法的空间复杂度是指A)算法在执行过程中所需要的计算机存储空间B)算法所处理的数据量C)算法程序中的语句或指令条数D)算法在执行过程中所需

2、要的临时工作单元数(5)软件设计中划分模块的一个准则是A)低内聚低耦合B)高内聚低耦合C)低内聚高耦合D)高内聚高耦合(6)下列选项中不属于结构化程序设计原则的是A)可封装D)自顶向下C)模块化D)逐步求精(27)有如下程序:#include using namespace std;class Toypublic:Toy(char* _n) strcpy (name,_n); count+;Toy() count-; char* GetName() return name; static int getCount() return count; private:char name10;stat

3、ic int count;int Toy:count=0;int mail()Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”);coutusing namespace std;class A public:A(int i):rl(i) void print() cout class A;下列声明中,与上述声明不等价的是A)template class A;B)template class A;C)template class A;D)template class A;(26)下列关于 C+流的描述中,错误的是A)coutA表达式可输出字符 AB)eof()函

4、数可以检测是否到达文件尾C)对磁盘文件进行流操作时,必须包含头文件 fstreamD)以 ios_base:out 模式打开的文件不存在时,将自动建立一个新文件 (27)有如下程序:#include using namespace std;class Toypublic: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:c

5、ount=0;int mail()Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”);coutusing namespace std;class A public:A(int i):rl(i) void print() coutusing namespace std;class Namechar name20;public:Name()strcpy(name,” ”); coutusing namespace std;public:AA() coutusing namespace std;class C1public:C1() coutusing namesp

6、ace std;class Publication /出版物类char name30;public:Publication(char *name=”未知名称”)strcpy(this-name,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()

7、const return “书“;;void showPublication( Publication &p)cout#includeUsing namespace std;int main()int s=123, 234;cout20; i-=2) coutusing namespace std;class GrandChildpublic:GrandChild() strcpy (name,”Unknown”); const char * getName()const return name; virtual char * getAddress()const=0;private:char

8、name20;class GrandSon : public GrandChildpublic:GrandSonchar *name Char * getAddress() const return “Shanghai”; ;int main()GrandChild *gs=new GrandSon(“Feifei”);coutgetName()getAddress()#include using namespace std;class Wordpublic:Word(string s) : str(s) string getStr() return str; 【14】 const return (strclass Datapublic:void put (T v) val=v; 【15】 get() /返回数据成员 val 的值,返回类型不加转换 return val; private:T val;

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 中学教育 > 试题/考题

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号