题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-24 22:13:03

[填空题]补充完整下面的类定义:
class XCH
char*a;
public:
XCH(char*aa) //构造函数
a=new char[strlen(aa)+1];
strcpy(a,aa);

XCH& operator=(const XCH& x) //重载赋值函数
delete[]a;
a=new char[strlen(x,a)+1];
strcpy(a,x,a);
______;

~XCH( )delete[]a;)

更多"补充完整下面的类定义: class XCH char*a; "的相关试题:

[填空题]补充完整下面的类定义:
class XCH
char*a;
public:
XCH(char*a A) //构造函数
a=new char[strlen(aA) +1];
strcpy(a,aA) ;

XCH&operator=(const XCH&x)//重载赋值函数
delete[ ]a;
a=new char[strlen(x.A) +1];
strcpy(a,x.A) ;
______;

~XCH( )delete[ ]a;

[填空题]请将下列类定义补充完整 class Base{public: void fun( ){cout<<"Base::fun"<<end1;}}; class Derived:public Base { public: void fun( ){ ______//显式调用基类的fun函数 cout<<"Derived::fun"<<end1; } };
[填空题]将下面程序补充完整。
public class PowerCale
 public static void main(String[] args)
  double x=5.0;
  System.out.println(x+"to the power 4 is"+power(x,4));
  System.out.println("7.5 to the power 5 is"+power(7.5,5));
  System.out.println("7.5 to the power 0 is"+power(7.5,0));
  System.out.println("10 to the power -2 is"+power(10,-2));
 
 static double ______ (double x,int n)
  if(n>1)return x * power(x,n-1);
  else if(n<0)return 1.0/power(x,-n);
  else return n==0 1.0:x:
  

[填空题]请将下列类定义补充完整。 class Base {public:void fun( ) {cout<<"Base:: fun"<<end1; } }; class Derived: public Base { public: void fun( ) { 【13】 //显式调用基类的fun函数 cout<<"Derived:: fun"<<end1; } };
[填空题]将下面程序补充完整。 public class PowerCale {  public static void main(String[] args) {   double x=5.0;   System.out.println(x+"to the power 4 is"+power(x,4));   System.out.println("7.5 to the power 5 is"+power(7.5,5));   System.out.println("7.5 to the power 0 is"+power(7.5,0));   System.out.println("10 to the power -2 is"+power(10,-2));  }  static double ______ (double x,int n) {   if(n>1)return x * power(x,n-1);   else if(n<0)return 1.0/power(x,-n);   else return n==0 1.0:x:   } }
[填空题]请将下列类定义补充完整。 class Base{public:void fun( ){tout<<"Base::fun"<<endl;}}; class Derived:public Base { public: void fun( ) { ______//显示调用基类的fun函数 cout<<"Derived::fun"<<endl; };
[填空题]请将下列类定义补充完整。
class Base public: void fun( )cout<<"Base::fun"<<end1; ;
class Derived:public Basepublic:
void fun( ) 【15】 //显式调用基类的fun函数
cout<<"Derived:: fun"<<end1;;
[填空题]请将下列类定义补充完整。
class Base(public:void fun( )cout<<"Base::fun"<<endl;;
class Derived:public Base

public:
void fun( )
______ //显式调用基类的fun函数
cout<<"Derived::fun"<<endl;


[填空题]补充完整下面的类定义:
const double PI=3.14;
class Circle //圆形物体的抽象基类
protected:
double r; //半径
public:
Circle(double radius=0):r(radius)
(13) ; //计算圆形物体表面积的纯虚函数声明

class Cylinder:public Circle //圆柱体类
double h; //高度
public:
Cylinder(double radius=0,double height=0);
Circle(radius),h(height)
Virtual double Area( )return 2*PI*r*(r+h); //计算圆柱体的表面积

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码