软件详细设计产生的图如下: 该图是()
A.N-S图 B.PAD图 C.程序流程图 D.E-R图
有三个关系R,S和T如下: 其中关系T由关系R和S通过某种操作得到,该操作为()
A.选择 B.投影 C.交 D.并
有如下程序: #include<iostream> using namespace std; class C1{ public: ~C1(){ cout<<1; } }; Class C2: public c1{ public: ~c2(){ cout<<2; } }; int main(){ C2 cb2; C1 *cb1; return 0; } 运行时的输出结果是
A.121 B.21 C.211 D.12
有如下程序: #include #include Using namespace std; int main(){ int s[]={123, 234}; cout< for(int i=0; i<2; i++) { cout< return 0; } 运行时的输出结果是()
A.123 234 B.***123 234 C.***123 ***234 D.***123 234***
有如下类定义 class A { char *a; public: A():a(0){} A(char *aa){ //把aa所指字符串拷贝到a所指向的存储空间 a= ; strcpy(a,aa); strcpy(a,aa); } ~A() {delete []a;} }; 横线处应填写的表达式是
A.nes char[strlen(aa)+1] B.char[strlen(aa)+1] C.char[strlen(aa)] D.new char[sizeof(aa)-1]
有如下程序: #include <iostream> using namespace std; class Toy{ public: Toy(char* _n) { strcpy (name,_n); count++;} ~Toy(){ count--; } char* GetName(){ return name; } static int getCount(){ return count; } private: char name[10]; static int count; }; int Toy::count=0; int mail(){ Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”); cout< return 0; } 运行时的输出结果是
A.1 B.2 C.3 D.运行时出错
有如下程序: #include<iostream> using namespace std; class Name{ char name[20]; public: Name(){ strcpy(name,””); cout<<’’; } Name(char *fname)){ strcpy(name,fname); cout<’’; } }; int main(){ Name names[3]={Name(“张三”),Name(“李四”)}; Return 0; } 运行此程序输出符号?的个数是
A.0 B.1 C.2 D.3
有如下程序 #include <iostream> using namespace std; class A { public: A(int i):rl(i) {} void print() {cout<<’e’< void print() const {cout<<’C’< private: int rl; }; int main(){ A al(2); const A a2(4); Al.print();a2.print(); Return 0; } 运行时的输出结果是
A.运行时出错 B.E2-C16- C.C4-C16- D.E2-E4-
有如下程序: #include<iostream> using namespace std; public: AA(){ cout<<’1’; } }; class BB: public AA{ int k; public: BB():k(0){ cout<<’2’; } BB(int n):k(n){ cout<<’3’;} } int main(){ BB b(4), c; return 0; } 运行时的输出结果是
A.1312 B.132 C.32 D.1412
有如下程序 #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< } int main(){ Book book(“精彩人生”); showPublication(book); return 0; } 运行时的输出结果是
A.未知类型:未知名称 B.未知类型:精彩人生 C.书:未知名称 D.书:精彩人生