填空题Jackson方法是一种面向{{U}} 【2】 {{/U}}的结构化方法。
填空题以下程序运行后的输出结果是 【12】 。#include <iostream.h>main()int i=10,j=0;doj=j+ i; i--;while(i>2);cout<<j;
填空题诊断和改正程序中错误的工作通常称为
______
。
填空题下面的类中定义了一个枚举类型,请完成下面的程序。
class Base {
public:
enum Week {Sum, Mon,Tue, Wed, Thu, Fri, Sat};
Week a;
}
void fun(Base &B) {
{{U}} 【12】 {{/U}}={{U}} 【13】 {{/U}}; //将对象的a赋值为所定义的枚举类型值为的枚举量
}
填空题operator是运算符重载时必须使用的关键字,它和被重载的运算符连在一起,作为运算符函数的专用函数名,务必把该函数说明为{{U}} 【11】 {{/U}}的。
填空题下列程序的运行结果是 【9】 。 # include <iostream. h> class test private: int num; public: test() int TEST() return num+100; ~test() ; test::test()num=0; test::~test()cout<<"Destructor is active"<<endl; void main() test x[3] cout<<x[1]. TEST()<<endl;
填空题C++语言支持的两种多态性分别是编译时的多态性和
______
的多态性。
填空题对于下面定义的类MyClass,请在函数f( )中添加对象成员把n的值修改为50。
class MyClass
{
public:
MyClass(int x){n=x;}
void SetNum (int nl) {n=nl;}
private:
int n;
};
int f( )
{
MyClass * ptr=new MyClass(45);
{{U}} 【12】 {{/U}}
}
填空题请定义一个函数名为A,返回值为int,没有参数的纯虚函数的定义是,
________
。
填空题我们通常用到的cin > > ,是属于{{U}} 【15】 {{/U}}输入。
填空题排序是计算机程序设计中的一种重要操作,常见的排序方法有插入排序、{{U}} 【5】 {{/U}}和选择排序等。
填空题使用VC6打开考生文件夹下的工程test22_1,此工程包含—个源程序文件test22_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果为: 6/15 3/4 9/19 源程序文件test22_1.cpp清单如下: #include<iostream.h> class Franction int nume; int deno; public: Franction FranAdd(const Franction deno=l; void InitFranction(int n, int d) nume=n; deno=d; void FranOutput() cout<<nume<<'/'<<deno<<endl; ; void main() Franction *a=new Franction; Franction *b=new Franction; a->InitFranction(6,15); b->InitFranction(3,4); a->FranOutput(); b->FranOutput(); Franction c; /****************found*******************/ c->InitFranction(); /****************found*******************/ c=a->FranAdd(b); c. FranOutput();
填空题语句cout<<setiosflags(ios::showpos)<<125<<"/t"<<-125<<endl;的输出结果为______。
填空题在最坏情况下,堆排序需要比较的次数为 【2】 。
填空题继承的方式有公有继承、私有继承和 【13】 3种。
填空题关系操作的特点是
______
操作。
填空题一棵二叉树第八层(根结点为第一层)的结点数最多为{{U}} 【1】 {{/U}}个。
填空题下面程序的运行结果是______。
#include<iostream.h>
void main()
{
char str[]="SSSWLIA",c;
int k;
for(k=2;(c=str[k]!='/0';k++)
{
switch(c)
{
case'T':++k;break;
case'1';continue;
default;cout<<c;continue;
}
cout<<'*;
}
}
填空题在C++中,运行时的多态性是通过______体现的。
填空题插入排序算法的主要思想是:每次从未排序序列中取出一个数据,插入到已排序序列中的正确位置。InsertSort类的成员函数sort( )实现了插入排序算法。请将画线处缺失的部分补充完整。 class InsertSort public: InsertSort(int*aO,int nO):a(aO),n(nO) //参数a0是某组首地址,n是数组元素个数 void sort( ) //此函数假设已排序序列初始化状态只包含a[0],未排序序列初始为a[1]...a[n-1] for(int i=1;i<n;++i); int t=a[i]; int j; for(______;j>0;--j) if(t>a[j-1])break; a[j]=a[j-1]; a[j]=t; protected: int*a,n; //指针a用于存放数组首地址,n用于存放数组元素个数 ;
