全部知识点
第6221题
已知基类Employee只有一个构造函数,其定义如下: Employee::Employee(int n):id(n){} ,Manager是Employee的派生类,则下列对Manager的构造函数的定义中,正确的是()。
第6222题
运行这个程序的输出结果是()。
#include<iostream>
using namespace std;
class A{
public:
A(){cout<<'A';}
~A(){cout<<'C';}
};
class B:public A{
public:
B(){cout<<'G';}
~B(){cout<<'T';}
};
int main(){
B obj;
return 0;
}
第6223题
有如下程序,运行这个程序的输出结果是()。
#include<iostream>
using namespace std;
class Mountain{
int height;
public:
Mountain (int h=0):height(h) {}
virtual char* GetName() const { return "山";}
int GetHeight() const { return height;}
};
class Lushan:public Mountain{
public:
Lushan(int d):Mountain(d) {}
char* GetName() const { return "庐山";}
};
int main(){
Mountain *p=new Lushan(1000);
cout<<p->GetName()<<"海拔"<<p->GetHeight()<<"米";
return 0;
}
第6224题
在C++中,用于实现运行时多态性的是()。
第6225题
下列关于虚函数的说明中,正确的是()。
第6226题
有如下程序,运行此程序,屏幕上将显示输出()。
#include<iostream>
using namespace std;
class A{
public:
virtual void func1(){cout<<"A1";}
void func2(){cout<<"A2";}
};
class B:public A{
public:
void func1(){cout<<"B1";}
void func2(){cout<<"B2";}
};
int main(){
A *p=new B;
p->func1();
p->func2();
return 0;
}
第6227题
有如下程序,运行时输出的结果是()。
#include<iostream>
using namespace std;
class Base{
int a,b;
public:
Base(int x, int y){a=x; b=y;}
void show() {cout<<a<<','<<b<<endl;}
};
class Derived:public Base{
int c,d;
public:
Derived(int x,int y,int z,int m):Base(x,y){c=z; d=m;}
void show() {cout<<c<<','<<<d<<endl;}
};
int main(){
Base B1(50,50),*pb;
Derived D1(10,20,30,40);
pb=&D1;
pb->show();
return 0;
}
第6228题
有如下程序,运行时输出的结果是()。
#include<iostream>
using namespace std;
class Base{
public:
virtual void f(){cout<<"f0+";}
void g() { cout<<"g0+";}
};
class Derived:public Base{
public:
void f(){cout<<"f+";}
void g() { cout<<"g+";}
};
int main(){
Derived d;
Base *p=&d;
p->f(); p->g();
return 0;
}
第6229题
有如下程序,运行时的输出结果是()。
#include <iostream> using namespace std;
class Publication{ //出版物类 char name[30];
public: Publication(char *name="未知名称"){ strcpy(this->name,name);
} const char* getName()const{
return name; }
virtual const char* getType()const{ return "未知类型";} };
class Book:
public Publication{ //书类 public: Book(char *name):
Publication(name){}
virtual const char* getType()const{ return "书";} };
void showPublication( Publication &p){ cout<<p.getType()<<":"<<p.getName()<<endl; }
int main(){ Book book("精彩人生");
showPublication(book);
return 0; }
第6230题
有如下程序,运行时的输出结果是()。
#include<iostream> using namespace std; class B{
public: B(int xx):x(xx){++count;x+=10;}
virtual void show() const {cout<<count<<'_'<<x<<endl;}
protected: static int count; private: int x; }; class D:
public B{ public: D(int xx,int yy):B(xx),y(yy){++count;y+=100;}
virtual void show() const {cout<<count<<'_'<<y<<endl;}
private: int y; };
int B::count=0; int main(){ B *ptr=new D(10,20); ptr->show(); delete ptr; return 0; }
第6231题
有如下程序,下列叙述中正确的是()。
#include<iostream> using namespace std;
class Instrument{ public: virtual void Display()=0; };
class Piano : public Instrument{ public: void Display(){/*函数体程序略*/} };
int main(){ Instrument s; Instrument *p=0; //... return 0; }
第6232题
有如下程序,若程序运行时输出结果是“文学”,则划线处缺失的语句是()。
#include
using namespace std;
class Book{
public:
Book(char*t="") {strcpy(title,t);}
private:
char title[40];
};
class Novel: public Book{
public:
Novel(chart=""): Book(t){}
charCategory() const { return "文学";}
};
int main(){
Book pb;
pb=new Novel();
cout<Category();
return 0;
}
第6233题
下列叙述中正确的是
第6234题
一棵二叉树有25个结点,其中5个是叶子结点,则度为1的结点数为
第6235题
在下列模式中,能够给出数据库物理存储结构与物理存取方法的是
第6236题
在满足实体完整性约束的条件下
第6237题
有三个关系R、S和T,则由关系R和S得到关系T的操作是
关系 R:
| A | B | C |
| a | 1 | 2 |
| b | 2 | 1 |
| c | 3 | 1 |
关系 S:
| A | B | C |
| a | 1 | 2 |
| b | 2 | 1 |
关系 T:
| A | B | C |
| c | 3 | 1 |
第6238题
软件生命周期的活动中不包括
第6239题
下面不属于需求分析阶段任务的是
第6240题
在黑盒测试方法中,设计测试用例的主要根据是