填空题在C++中封装性、继承性和{{U}} [2] {{/U}}是面向对象思想的主要特征。
填空题一个关系表的行为 __________ 。
填空题下列程序的输出结果为-5/8-3/4,请将横线处的缺失部分补充完整。
#include<iostream>
using namespace std;
class Fraction{//"分数"类
public:
Fraction(double a, double B) : num(A) , den(B) {}
~Fraction(){}
Fraction operator -(){
______;
f. num=-f. num;;
return f;
}
void print(){cout<<num<<"/"<<den<<" "}
private:
double num;
double den; //分母
};
int main(){
Fraction f1(5,8), f2(3, 4);
(-f1) print(); (-f2). print();
return 0:
}
填空题下列程序将x、y和z按从小到大的顺序排列,请将下面的函数模板补充完整。 template<class T> void order( ) T al if(x>y) a=x;x=y; y=a; if(y>z) a=y;y=Z; z=a; if(x>y) a=X;X=y; y=a;
填空题若串s="MathTypes",则其子串的数目是 【3】 。
填空题下列程序的输出结果为
Object id=0
Object id=1
请将程序补充完整。
#include <iostream>
using namespace std;
class Point
{
public:
Point(int xx=0,int yy=0) {X=xx; Y=yy; countP++;}
~Point(){countP--; }
int GetX(){retum X;}
int GetY(){return Y;}
static void GetC() { cout<<"Object id="<<countP<<end1;}
private:
int X,Y;
static int countP;
};
{{U}}【11】 {{/U}} //静态数据成员的初始化
int main()
{
Point:: GetC();
Point A(4,5);
A. GetC();
retum 0;
}
填空题下面程序的运行结果是{{U}} 【8】 {{/U}}和 {{U}}【9】 {{/U}}。
#include<iostream.h>
#define N 10
#defines(x)X*X
#define f(x)(X*X)
void main()
{ int il,i2;
i1=1000/s(N);i2=1000/f(N);
cout << i1 << " " << i2;
}
填空题数据库技术的主要特点为数据的集成性数据的高{{U}} 【5】 {{/U}}和低冗余性、数据独立性和数据统一管理与控制。
填空题下面程序的输出结果是{{U}} {{/U}}。
#include<iostream.h>
void main( )
{
int a[6] ={1,2,3,4,5,6};
for(int i=0;i<5;i++)
cout < < a[i] < <" ";
cout < < endl;
填空题下列程序的执行结果为【15】。 #include void main( ) { cout.fill( ' * ' ); cout.width(10); cout }
填空题如果一个对象部分地包含自己,或自己定义自己,则称这个对象是{{U}} 【3】 {{/U}}的对象。
填空题下面程序的输出结果为
________
。
#include <iostream>
using namespace std;
void initialize(int printNo,int state=0);
void initialize(int printNo=1,int state);
int main()
{
initialize();
return 0;
}
void initialize(int printNo, int state)
{
cout<<printNo<<","<<state<<end1;
}
填空题有如下语句序列: int arr[2][2]=9,8,7,6; int *p=arr[0]+1;cout<<*p<<end1; 运行时的输出结果是______。
填空题流操作子 ______ 向输出流中插入一个换行符并刷新输出缓冲区。
填空题下列程序的执行结果为【15】。 #include void main( ) cout.fill( ' * ' ); cout.width(10); cout
填空题有如下程序: #include<iostream> using namespace std; class Con char ID; public: Con():ID('A') cout<<1; Con(char ID) :ID(ID) cout<<2; Con(Con char get1D()constreturn ID; ; void show(Con c) cout<<c.getID(); int main() Con c1; show(c1); Con c2('B'); show(c2); return 0; 执行上面程序的输出是______。
填空题若要将一个模块的功能逐步分解,细化为一系列具体的步骤,进而用某种程序设计语言写成程序,应该在程序设计阶段采取{{U}} 【2】 {{/U}}和逐步求精的方法。
填空题有如下程序: #include<iostream> using namespace std; class CA public: CA()cout+'A'; ; class CB: private CA public: CB()cout<<'B'; ; int main() CA a; CB b; return 0; 这个程序的输出结果是______。
填空题下列程序的输出结果为: 0bject id=0 0biect id=1 请将程序补充完整。 #include<iostream> using namespace std; class Point public: Point(int xx=0,int yy=0)X=xx;Y=yy;countP++; ~Point()countP--; int GetX()return X; int GetY()return Y; static void GetC()cout<<"0bject id="<<countP<<end1; private: int X,Y; static int countP; ; ______//静态数据成员的初始化 int main() Point::GetC(); Point A(4,5); A.GetC(); return 0;
填空题多继承情况下,派生类对基类成员的访问会出现二义性。解决二义性的方法是{{U}} 【13】 {{/U}}、 {{U}}【14】 {{/U}}和{{U}} 【15】 {{/U}}。
