填空题下列程序的运行结果是{{U}} 【14】 {{/U}}。
#include <iostream. h>
class A
{
int a, b;
public:
A() {a=b=0;}
A(int aa, int bb)
{
a=aa; b=bb;
cout<<a<<''<<b<<end1;
}
};
void main()
{ A x, y(2,3),z(4,5); }
填空题由关系数据库系统支持的完整性约束是指{{U}} 【4】 {{/U}}和参照完整性。
填空题以下程序的执行结果是{{U}} 【14】 {{/U}}。
#include<iostream>
using namespace std;
class base
{
public:
virmal void who(){cout<<"Base Class"<<endl;)
};
class Derivedl:public Base
{
public:
virtual void who(){cout<<"Derivedl Class"<<endl;}
};
class derived2:public Base
{
public:
virtual void who(){cout<<"Derived2 Class"<<endl;)
};
int main(int argc,char*argv[])
{
base obj1,*P;
deliVedl obj2;
derived2 obj3;
p=&obj1; p->who();
p=&obj2; p->who();
p=&obj3; p->who();
return 0;
}
填空题以下程序的执行结果为【 】。
#include<iostream>
using namespace std;
class base
{
public:
virtual void who( )
{
cout < < "base class" < <end1;
};
class derivel:public base
{
public:
void who( )
{
cout < <"derivel class" < <end1;
};
} class derive2:public base
{
public:
void who( )
{
cout< <"derive2 class"< <end1;
}
};
void main( )
{
base obj1,* p;
derivel obi2;
derive2 obj3;
p=&obj1;
p->who( );
p=&obj2;
p->who( );
p=&obj3;
p->who( );
}
填空题若以非成员函数形式,为类Bounce重载“!”运算符,其操作结果为一bool 型数据,则该运算符重载函数的原型是{{U}} 【12】 {{/U}}。
填空题给出下列二叉树的前序序列{{U}}[1]{{/U}}。
填空题如果一个派生类只有一个直接基类,则该类的继承方式称为______继承;如果一个派生类同时有多个直接基类,则该类的继承方式称为______继承。
填空题在定义类的对象时,C++程序将自动调用该对象的{{U}} 【11】 {{/U}}函数初始化对象自身。
填空题有如下程序:
#include<iostream>
using namespace std;
class DA{
int k;
public:
DA(int x=1):k(x){}
~DA(){cout<<k;}
};
int main(){
DA d[]={DA(3),DA(3),DA(3)};
DA*p=new DA[2];
delete []p;
return 0;
}
这个程序的输出结果是{{U}} 【14】 {{/U}}。
填空题以下程序的输出结果为______。
#include<iostream>
using namespace std;
int main()
{
int a[3][3]={{1,2},{3,4),{5,6}},i,j,s=0;
for(i=1;i<3;i++)
for(j=0;j<=i;j++)
s+=a[i][j];
cout<<s<<endl;
return 0;
}
填空题在派生类中,对类对象成员,基类成员和非类对象成员的初始化程序是 【7】 。
填空题下列程序的执行结果为 【13】 。 #include <iostream. h> class Point public: Point(double i, double j) x=i; y=j; double Area() const return 0.0; private: double x, y; ; class Rectangle: public Point public: Rectangle(double i, double j, double k, double 1) double Area() const return w * h; private: double w, h; ; Rectangle: :Rectangle(double i, double j, double k. double 1): Point(i,j). w=k, h=1 void fun(Point void main( ) Rectangle rec(3.0, 5.2, 15.0. 25.0); fun(rec)
填空题在C++语言的结构化程序设计中,{{U}} 【6】 {{/U}}是程序的基本组成单元;在C++语言的面向对象设计框架中,{{U}} 【7】 {{/U}}是程序的基本组成单元。
填空题在数据库的外模式、模式和内模式3级模式的体系结构中,存在两级映射:外模式到模式的映射定义了外模式与模式之间的对应关系;模式到内模式的映射定义了数据库的逻辑结构与______之间的对应关系。
填空题下列函数的功能是判断字符串str是否对称,对称则返回true,否则返回false。请在画线处填上适当内容,实现该函数。
bool fun(char*str)}
int i:0,j=0;
while(str[j]){{U}} {{U}} {{/U}} {{/U}};
for(J--;i<jstr[i]==str[J];i++,J--);
return i{{U}} {{U}} {{/U}}{{/U}} J;
}
填空题若将一个二元运算符重载为类的成员函数,其形参个数应该是{{U}} 【13】 {{/U}}个。
填空题假设int a=1,b=2;则表达式a+++--b的值为{{U}} {{/U}}。
填空题下列程序的输出结果是 【15】 。 #include <iostream> using namespace std; class base public: int n; base(iht x) n=x; virtual void set(int m) n=m;cout<<n<<''; ; class deriveA: public base public: deriveA(int x):base(x) void set(int m)n+=m;cout<<n<<''; : class deriveB:public base public: deriveB(int x):base(x) void set(int m) n+=m;cout<<n<<''; ; int main() deriveA d1(1); deriveB d2(3); base *pbase; pbase= pbase->set(1); pbase= pbase->set(2); return 0;
填空题下列程序的输出结果为{{U}} 【10】 {{/U}}。
#inelude<iostream. h>
int }
void main() {
int n=3, m=12;
max(m, n)++
cout<<"m="<<m<<", n= "<<n<<end1;
}
填空题若要访问指针变量q所指向的数据,应使用表达式______。
