cat5
cable
cat5 cable
cable cat5
第1题:
现有:classCat{Cat(intc){System.out.print("cat"+c+"");}}classSubCatextendsCat{SubCat(intc){super(5);System.out.print("cable");}SubCat(){this(4);}publicstaticvoidmain(String[]args){SubCats=newSubCat();}}结果为:()
A.cat5
B.cable
C.cablecat5
D.cat5cable
第2题:
有如下程序:
include<iostream>
using namespace std;
class Pet{
char name[10];
public:
Pet(char*name){strcpy(this->name,name);}
const char*getName()const {return name;}
virtual void call()const=0;
};
class Dog:public Pet{
public:
Dog(char*name):Pet(name){}
void call()const{cout<<"汪汪叫":}
};
class Cat:public Pet{
public:
Cat(char*name):Pet(name){}
void call()const{cout<<"喵喵叫";}
};
int main(){
Pet*pet1=new Dog("哈克"),*pet2=new Cat("吉米");
cout<<pet1->getName();pet1->call();cout<<end1;
cout<<pet2->getName();pet2->call();cout<<end1;
return 0;
}
程序的输出结果是______。
第3题:
LTE中UE的等级有几个?
A.Cat1
B.Cat2
C.Cat3
D.Cat4
E.Cat5
F.Cat6
第4题:
使用VC6打开考生文件夹下的工程test16_3,此工程
(1)定义类Cat 的保护数据成员itsAge用于表示年龄,它是int型的数据。请在注释“//**1**”之后添加适当的语句。
(2)定义类Cat的保护数据成员GetAge()的类外定义,返回成员的itsAge值,请在注释“//**2**”之后添加适当的语句。
(3)完成成员函数SetAge(int age)的类外定义,把数据成员itsAge赋值为参数age的值,请在注释“//**3**”之后添加适当的语句。
(4)完成成员函数Meow的类外定义,使其输出字节符串“meow.”到屏幕上。请在注释“**4**”后添加适当的语句。
输出结果如下:
meow.
kitty is a cat who is 5 years old.
meow.
注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。
源程序文件testll3.cpp清单如下:
include<iostream.h>
class Cat
{
public:
int GetAge();
void SetAge(int age);
void Meow();
protected:
//**1**
};
int Cat::GetAge()
{
//**2**
}
void Cat::SetAge(int age)
{
//**3**
}
void Cat: :Meow()
{
//**4**
}
void main ( )
{
Cat kitty;
kitty.Meow();
kitty. SetAge(5);
cout<<"kitty is a cat who is ";
cout<<kitty.GetAge();
cout<<" years old.\n";
kitty. Meow();
}
第5题:
A.Coaxial
B.Cat1UTP
C.Cat3UTP
D.Cat5UTP
第6题:
A.Cat
B.Dog
C.Compilationfails.
D.Thecoderunswithnooutput.
E.Anexceptionisthrownatruntime.
第7题:
A.CAT5
B.CAT3
C.CAT6
D.Thicknet
第8题:
如下程序的输出结果是______。
include<iostream>
using namespace std;
class Pet{
char name[10];
public:
Pet(char*nanle){strcpy(this->name,name);}
const char*getName( )const{return name;}
virtual void call( )eonst=0;
};
class Dog:public Pet{
public:
Dog(char*name):Pet(name){ }
void call( )eonst{cout<<"汪汪叫";}
};
class Cat:public Pet{
public:
Cat(char*name):Pet(name){ }
void call( )const{eout<<"喵喵叫";}
};
int main( ){
Pet*petl=new Dog("哈克"),*pet2=new Cat("吉米");
eout<<petl->getName( );petl->call( );eout<<endl;
cout<<pet2->getName( );pet2->call( );eout<<endl;
return 0;
}
第9题:
A.Cat1
B.Cat2
C.Cat3
D.Cat4
第10题:
cat testfile的输出与下面哪个命令相同?()