[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc

上传人:花仙子 文档编号:502510 上传时间:2018-11-29 格式:DOC 页数:28 大小:70.50KB
下载 相关 举报
[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc_第1页
第1页 / 共28页
[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc_第2页
第2页 / 共28页
[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc_第3页
第3页 / 共28页
[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc_第4页
第4页 / 共28页
[计算机类试卷]国家二级(C++)机试模拟试卷5及答案与解析.doc_第5页
第5页 / 共28页
点击查看更多>>
资源描述

1、国家二级( C+)机试模拟试卷 5及答案与解析 一、选择题 1 数据结构主要研究的是数据的逻辑结构、数据的运算和 ( )。 ( A)数据的方法 ( B)数据的存储结构 ( C)数据的对象 ( D)数据的逻辑存储 2 一棵二叉树的前序遍历结果是 ABCEDF,中序遍历结果是 CBAEDF,则其后序遍历的结果是 ( )。 ( A) DBACEF ( B) CBEFDA ( C) FDAEBC ( D) DFABEC 3 在数据处理中,其处理的最小单位是 ( )。 ( A)数据 ( B)数据项 ( C)数据结构 ( D)数据元素 4 在数据库系统的内部结构体系中,索引属于 ( )。 ( A)模式 (

2、 B)内模式 ( C)外模式 ( D)概念模式 5 以下 ( )不属于对象的基本特征。 ( A)继承性 ( B)封装性 ( C)分类性 ( D)多态性 6 数据库系统的核心是 ( )。 ( A)数据模型 ( B)软件开发 ( C)数据库设计 ( D)数据库管理系统 7 开发软件所需高成本和产品的低质量之间有着尖锐的矛盾,这种现象称做 ( )。 ( A)软件矛盾 ( B)软件危机 ( C)软件藕合 ( D)软件产生 8 关系模型允许定义 3类数据约束,下列不属于数据约束的是 ( )。 ( A)实体完整性约束 ( B)参照完整性约束 ( C)属性完整性约束 ( D)用户自定义的完整性约束 9 关系

3、表中的每一行记录称为一个 ( )。 ( A)字段 ( B)元组 ( C)属性 ( D)关键码 10 在数据库管理技术的发展中,数据独立性最高的是 ( )。 ( A)人工管理 ( B)文件系统 ( C)数据库系统 ( D)数据模型 11 下列语句中,错误的是 ( )。 ( A) const int buffer=-256; ( B) const int temp; ( C) const double*ooint; ( D) const double*rt=new double(5 5); 12 下列变量名中,合法的 ( )。 ( A) CHINA ( B) byte-size ( C) doub

4、le ( D) A+a 13 在进行任何 C+流的操作后,都可以用 C+流的有关成员函数检测流的状态;其中只能用于检测输入流状态的操作函数名称是 ( )。 ( A) fail ( B) eof ( C) bad ( D) good 14 对于语句 cout main() int m=5: if(m+5) cout void main() int x: cinx; if(x+5) cout using namespace std; int i=1; class Fun public: static int i; int value()return i一 1; int value()constre

5、turn i+l; ; int Fun: i=2; int main() int i=3: Fun fun1; const Fun fun2; return 0: 若程序的输出 结果是: 123 则程序中横线处的语句是 ( ) ( A) cout void main() int i(0); while(+i) if(i=10)break; iffi 3!=1)continue; cout using namespace std; class A public: A()COUI #include“string h” void main() char a=“Hello Test”, b=“Test

6、 strcpy(a, b): cout void main() char str25=“1234”, “5678”, *p2; int i,j s=0: for(i=0: i/0j+=2) s=10*s十 pij1一 0 ; cout using namespace std; void fun(char*q) +q: cout int fun(int); void main() int a=2, i; for(i=0; i using namespace std; int a: int fun(); int main() extern int a; int b: a=10; b=fun()

7、 cout using namespace std; class TestClass 1 public: TestClass l()cout void fun(char*str,char*s) void main() char str100, sil00; tout class TestClass public: *1* TestClass(int i,int j) m Numl=i: mNum3+: i; void Print() cout5成立 (此时 m的值变为 6),所以执行语句cout5不成 立,因为 “+”后缀,之后 x的值变为 5,执行语句 cout5成立,所以执行语句 cou

8、t类名 class:参数 =”,其中 为要初始化参数的类型, “: ”为作用域符号,说明参数是 class中的参数,所以这里补全 “intTestClass: m Num3=0; ”。 (4)函数。 fun()中 “Num Add(); ”语句应该 是调用类 “TestClass”中的成员函数“voidAdd(int i)”。其定义中存在参数 inti,所以注释下修改的语句缺少参数。主函数首先调用 “Num Print(); ”,即实现题目中输出的前三条语句,而 “fun(): ”语句实现后面三条语句的输出,即 “m Num3=7”才是调用 Num Add的输出结果,即 “m。 Num3+=i: ”的计算结果。 “TestClaLss Num(1, 2); ”中将 i的值初始化为1, “m Num3”的值在上一次 “Num Print(); ”调用中为 l,如果计算结果为 7,那么 Add(inti)中 i的初始化值为 5,即 “Num Add(5); ”。

展开阅读全文
相关资源
猜你喜欢
  • ASHRAE OR-05-7-2-2005 Analyzing Interrupted In-Situ Tests on Vertical Boreholes《垂直钻孔的分析中断原位测试》.pdf ASHRAE OR-05-7-2-2005 Analyzing Interrupted In-Situ Tests on Vertical Boreholes《垂直钻孔的分析中断原位测试》.pdf
  • ASHRAE OR-05-7-2005 Symposium on Ground-Coupled Heat Pump Design Issues《地面耦合热泵设计问题的研讨会》.pdf ASHRAE OR-05-7-2005 Symposium on Ground-Coupled Heat Pump Design Issues《地面耦合热泵设计问题的研讨会》.pdf
  • ASHRAE OR-05-7-3-2005 A Methodology to Evaluate Pumping Energy Consumption in GCHP Systems《评价GCHP系统的抽水能源消耗的一种方法》.pdf ASHRAE OR-05-7-3-2005 A Methodology to Evaluate Pumping Energy Consumption in GCHP Systems《评价GCHP系统的抽水能源消耗的一种方法》.pdf
  • ASHRAE OR-05-8-1-2005 Air Distribution in Rooms Generated by Textile Terminal-Comparison with Mixing and Displacement Ventilation《混合和置换通风与纺织终端所产生的相比的室内里的空气分配》.pdf ASHRAE OR-05-8-1-2005 Air Distribution in Rooms Generated by Textile Terminal-Comparison with Mixing and Displacement Ventilation《混合和置换通风与纺织终端所产生的相比的室内里的空气分配》.pdf
  • ASHRAE OR-05-8-2-2005 Displacement with Induction Conditioning Our Classrooms in Accordance with ANSI ASA S12 60《感应位移:按照美国ANSI ASA S12 60标准来调理我们的教室》.pdf ASHRAE OR-05-8-2-2005 Displacement with Induction Conditioning Our Classrooms in Accordance with ANSI ASA S12 60《感应位移:按照美国ANSI ASA S12 60标准来调理我们的教室》.pdf
  • ASHRAE OR-05-8-2005 Symposium on Innovations and Advances in Room Air Distrbution Part 2 Numerical Experimental and Application Articles《在室内空调器分布上的创新和进步的研讨会 第2部分 数值 实验和应用的文章》.pdf ASHRAE OR-05-8-2005 Symposium on Innovations and Advances in Room Air Distrbution Part 2 Numerical Experimental and Application Articles《在室内空调器分布上的创新和进步的研讨会 第2部分 数值 实验和应用的文章》.pdf
  • ASHRAE OR-05-8-3-2005 The Effect of Supply Air Systems on Kitchen Thermal Environment《对厨房热环境的供气系统的影响》.pdf ASHRAE OR-05-8-3-2005 The Effect of Supply Air Systems on Kitchen Thermal Environment《对厨房热环境的供气系统的影响》.pdf
  • ASHRAE OR-05-8-4-2005 Numerical Simulation of Airflow and Airborne Pathogen Transport in Aircraft Cabins - Part 1 Numerical Simulation of the Flow Field《气流和在飞机舱空中传播的病原的数值模拟-第1部分 流场.pdf ASHRAE OR-05-8-4-2005 Numerical Simulation of Airflow and Airborne Pathogen Transport in Aircraft Cabins - Part 1 Numerical Simulation of the Flow Field《气流和在飞机舱空中传播的病原的数值模拟-第1部分 流场.pdf
  • ASHRAE OR-05-8-5-2005 Numerical Simulation of Airflow and Airborne Pathogen Transport in Aircraft Cabins - Part II Numerical Simulation Airborne Pathogen Transport《在飞机舱里的病原空中传播和气流数.pdf ASHRAE OR-05-8-5-2005 Numerical Simulation of Airflow and Airborne Pathogen Transport in Aircraft Cabins - Part II Numerical Simulation Airborne Pathogen Transport《在飞机舱里的病原空中传播和气流数.pdf
  • 相关搜索

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

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