计算机类
公务员类
工程类
语言类
金融会计类
计算机类
医学类
研究生类
专业技术资格
职业技能资格
学历类
党建思政类
计算机等级考试(NCRE)
全国计算机应用水平考试(NIT)
计算机软件水平考试
计算机等级考试(NCRE)
全国高校计算机等级考试CCT
行业认证
信息素养
计算机等级考试二级
计算机等级考试一级
网络工程师(计算机等级考试四级)
计算机等级考试二级
数据库工程师(计算机等级考试四级)
计算机等级考试三级
信息安全工程师(计算机等级考试四级)
嵌入式系统开发工程师(计算机等级考试四级)
软件测试工程师(计算机等级考试四级)
C++语言程序设计
Python语言程序设计
WPS Office高级应用与设计
C语言程序设计
C++语言程序设计
Java语言程序设计
Visual Basic语言程序设计
Web程序设计
Access数据库程序设计
MySQL数据库程序设计
Visual FoxPro数据库程序设计
办公软件高级应用
填空题类的构造函数是一个特殊的成员函数,它由类的对象自动调用。它的作用是 【11】 。
进入题库练习
填空题C++语言程序的注释可以出现在程序中的任何地方,一个注释以 【7】 作为开始和结束的标记。
进入题库练习
填空题设i,j,k均为int型变量,则执行完for(i=0,j=10;i<=j;i++,j--)k=i+j;语句后,k的值为{{U}} 【8】 {{/U}}。
进入题库练习
填空题按“先进先出”原则组织数据的数据结构是 【3】 。
进入题库练习
填空题以下程序运行后的输出结果是{{U}} 【10】 {{/U}}。 #include <iostream> #include <string> using namespace std; class Y; class X { iht x; char *strx; public: X(int a,char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y }; class Y { private: iht y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+ 1] ; strcpy(stry, str); } friend void X::show(Y }; void X::show(Y cout<<ob.stry<<endl; } int main() { X a(10,"stringX"); Y b(20,"stringY"); a.show(b); return 0; }
进入题库练习
填空题在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 #include <iostream> using namespace std; class A public: A() cout<<'A'; ; class B:______ public: B() cout<<'B'; ; class C:virtual public A public: C() cout<'C'; ; class D:public B,public C public: D() cout<<'D'; ; void main() D obj;
进入题库练习
填空题有如下程序: #include<iostream> using namespace std; int fun1(int x) {return++x;} int fun2(int } int main(){ int x=1,y=2; y=fun 1(fun2(x)); cout<<X<<','<<y; return 0: } 程序的输出结果是______。
进入题库练习
填空题将以下程序写成三日运算表达式是 【9】 。if(a>b) max=a;else max=b;
进入题库练习
填空题在数据库系统中,数据具有独立性。由于数据的存储结构与逻辑结构之间由系统提供映象,使得当数据的存储结构改变时,其逻辑结构可以不变,因此,基于逻辑结构的应用程序不必修改。这种独立性称为 【5】 。
进入题库练习
填空题以下程序运行后的输出结果是{{U}} 【14】 {{/U}}。 #include <iostream> #include <string> using namespace std; class Y; class X { int x; char *strx; public: X(int a,char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X::show(Y }; void X::show(Y cout<<ob.stry<<end1; } int main() { X a(10,"stringX"); Y b(20,"stringY"); a. show (b) ; return O; }
进入题库练习
填空题在下面程序的横线处填上适当的内容,使程序执行后的输出结果果为1/2005。 #include<iostmam> using namespace std; class Date public: Date(int m=1,int y=0):month(m),year(y) void Print()cout<<month<<"/"<<year<<endl; operator+(const Date private: int month,year; ; operator+(const Date year=d1.year+d2.year; month=d1.month+d2.month; year+=(month-1)/12; month=(month-1)%12+1; return Date(month,year); void main() Date d1(3,2004),d2,d3(10); d2=d3+d1; d2.Print();
进入题库练习
填空题使用VC++6.0打开考生文件夹下的源程序文件3.cpp,要求编写一个CMyShape类,含有求面积、周长等的纯虚函数,然后编写一个CRectangle类和CCircle类继承CMyShape,并实现求面积、周长的两个函数。在main函数中测试得到下面的结果: 在CMyShape类构函数造内 在CCircle类构造函数内 在CMyShape类构造函数内 在CRectangle类构造函数内 myCircle:Area=314.159 Girth=62.8319 myRectangle:Area=900 Girth=120 具体要求如下: (1)定义求面积的纯虚函数,请在注释1后添加适当的语句。 (2)定义求周长的纯虚函数,请在注释2后添加适当的语句。 (3)请在注释3和注释4后添加适当的语句。 注意:除在指定位置添加语句之外,不要改动程序中的其他内容。 试题程序: #include<iostream.h> #include<math.h> #define PI 3.1415926 class CMyPoint public: int x,y; CMyPoint(int tx,int ty):x(tx),y(ty) ; class CMyShape public: CMyShape()cout<<"在CMyShape类构造函数内"<<end1; //********1******** //********2******** protected: ; class CCircle:public CMyShape public: CCircle(CMyPoint i,double j):CMyShape(),arcCenter(i),radius(j) cout<<"在CCircle类构造函数内"<<end1; double GetArea() return PI *radius *radius; double GetGirth() return 2*PI*radius; private: CMyPoint arcCenter; double radius; ; class CRectangle:public CMyShape public: CRectangle(CMyPoint lt,CMyPoint rb):leftTop(lt),rightBottom(rb),CMyShape() cout<<"在CRectangle类构造函数内"<<end1; double GetArea() int width=abs(rightBottom.x-leftTop.x); int height=abs(rightBottom.y-leftTop.y); return width *height; double GetGirth() int width=abs(rightBottom.x-leftTop.x); int height=abs(rightBottom.y-leftTop.y); return 2*(width+height); private: CMyPoint leftTop,rightBottom; ; void main() CMyShape *myShape=NULL; CCircle *myCircle=new CCircle(CMyPoint(5,5),10); CRectangle *myRectangle=new CRectangle(CMyPoint(0,0),CMyPoint(30,30)); //********3******** cout<<"myCircle:"<<"Area="<<myShape—>GetArea()<<"/t"<<"Girth="<<myShape—>GetGirth()<<end1; //********4******** cout<<"myRectangle:"<<"Area="<<myShape—>GetArea()<<"/t"<<"Girth="<<myShape—>GetGirth()<<end1;
进入题库练习
填空题要想把类的一般成员函数说明为类的常成员函数,则应该使用关键词{{U}} 【11】 {{/U}}说明成员函数。
进入题库练习
填空题阅读下列程序,写出程序的运行结果{{U}} [8] {{/U}}。 #include<iostream. h> void main() {  char str1[ ]: "Hello, World?; char str2[100]; int i=0; do{ if (str1[i]>= 'a' else str2[i]=strl [i]; i++; }while(strl[i]!='/0'); str2[i]='/0'; cout<<str1<<end1; cout<<str2<<end1; }
进入题库练习
填空题若x和y是两个整型变量,在执行了语句序列: x=5; y=6; y+=x--; 后,x+y的值为______。
进入题库练习
填空题下面程序的运行结果是______和______。 #include<iostream.h) #define N 10 #define s(x)x*x #define f(x)(x*x) void main() int i1,i2; i1=1000/s(N);i2=1000/f(N); cout<<i1<<""<<i2;
进入题库练习
填空题已知下列程序的输出结果是42,请将下画线处缺失的部分补充完整。 #include <iostream> using namespace std; class Foo int value; public: Foo( ):value(0) void setValue(int value) ______=value;//给Foo的数据成员value赋值 void print( )eout<<value; ; int main( ) Foo f; f.setValue(42); f.print(); return 0;
进入题库练习
填空题以下函数模板max 的功能是返回数组a中最大元素的值。请将横线处缺失部分补充完整。 template <typename T>T max(T a[],int n) { T m=a[0]; for(int i=1 ;i<n;i++) if(a[i]>m){{U}} 【14】 {{/U}} return m; }
进入题库练习
填空题下面程序的运行结果是{{U}} {{U}} {{/U}} {{/U}}。 #include <iostream> using namespace std; class count { static int n; public: count() { n++; } static int test() { for(int i=0;i<4;i++) n++; return n; } }; int count::n = O; int main() { cout<<count:: test()<<" "; count c1, c2; cout<<count:: test()<<endl; return 0; }
进入题库练习
填空题在下面横线上填上适当的语句,完成程序。 #include<iostream> using namespace std; class TestClass int x; public: TestClass(int i)x=i; ~TestClass() ; class TestClass1:public TestClass public; ______//完成类TestClassl构造函数的定义 ; int main() TestClass1 0bj(); return 0;
进入题库练习