填空题使用如setw ()的操纵符对数据进行格式输出时,应包含 【7】 文件。
填空题执行下列语句后,变量sum的值是______。 int sum=0; for(int i=1;i<=3;i++) for(int j=1;j<=i;j++) sum++;
填空题函数swap(arr,n)可完成对arr数组从第1个元素到第n个元素两两交换。在运行调用函数中的语句后,a[0]和a[1]的值分别为 【7】 。 a[0]=1;a[1]=2;swap(a,2);
填空题若a. b和c均是int型变量,则表达式a=(b=4)+(c=2)执行后,a的值为 【9】 。
填空题在计算机软件系统的体系结构中,数据库管理系统位于用户和
________
之间。
填空题请将下面的类Date的定义补充完整,使得由语句
Date FirstDay;
定义的对象FirstDay的值为2010年1月1日。
class Date{
public:
Date( 【11】 ):year(y),month(m),day(d){ }
private:
int year,month,day; //依次表示年、月、日
};
填空题关系中的属性或属性组合,其值能够惟一地标识一个元组,该属性或属性组合可选作为 【5】 。
填空题若有以下程序:
#include〈iostream〉
using namespace std;
class Base
{
public:
Base ( )
{
x=0;
}
int x;
};
class Derived1 : virtual public Base
{
public:
Derived1()
{
x=10;
}
};
class Derived2 : virtual public Base
{
public:
Derived2()
{
x=20;
}
};
class Derived : public Derived1,protected Derived2
{ };
int main()
{
Derived obj;
cout〈〈obj.x〈〈end1;
return 0;
}
该程序运行后的输出结果是〈u〉 【15】 〈/u〉。
填空题下列程序的输出结果为{{U}} 【8】 {{/U}}。
include<iostream.h>
voidmain()
{
inta []={10,20,30,40},*pa=a;
int*&ph=pa;
Pb++;
cout<<*pa<<end1;
}
填空题结构化程序设计方法的主要技术是 【5】 、逐步求精。
填空题假定A为一个类,则语句A(A&a);为该类{{U}} 【12】 {{/U}}函数的原型说明。
填空题如果不使用多态机制,那么通过基类的指针虽然可以指向派生类对象,但是只能访问问从基类继承的成员。下列程序没有使用多态机制,其输出结果是{{U}} 【11】 {{/U}}。
#include <iostream>
using namespace std;
class Base {
public:
void print ( ) {cout << 'B'; }};
class Derived: public Base {
public:
void print ( ) {cout <<'D';}};
int main( )
{
Derived* pd = new Derived( );
Base* pb = pd;
pb->print( );
pd->print();
delete pd;
return 0;
}
填空题线性表最常用的操作是存取第i个元素及其前趋的值,则采用{{U}} [1] {{/U}}存储方式节省时间。
填空题在C++语言的面向对象程序设计框架中,{{U}} {{U}} {{/U}} {{/U}}是程序的基本组成单元。
填空题已知 int DBL(int n)return n+n;和 long DBL(long n)return n+n)是一个函数模板的两个实例,则该函数模板的定义是 【13】 。
填空题有如下程序段:
int n=0,sum=0;
while(n++,n<50){
if(n%2= =0)continue;
sum+=n;
}
cout<<sum;
此程序段执行的输出结果为
________
,while语句共执行了
________
次。
填空题全面支持软件开发过程的软工具集合被称为______。
填空题对虚函数的调用有两种方式:{{U}} 【11】 {{/U}}和{{U}} 【12】 {{/U}}。
填空题对象根据所接受的消息而做出动作,同样的消息被不同的对象所接受时可能导致完全不同的行为,这种现象称为______。
填空题程序
#include"iostream.h"
void main()
{
int i=10;
int i=5;
cout <<j+i++<<endl;
}
的结果为{{U}} 【7】 {{/U}}。