⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cone.cpp

📁 这个是继承与派生的实验
💻 CPP
字号:
//圆锥.cpp
 
#include<iostream.h>
#include<string.h>
#include"cone.h"
#include<math.h>
const double PI=3.14159;
cone::cone(double R,double h,double a):circle(R)
{
	hight=h;
    angle=a;
}
double cone::setA(double R,double h,double a)   //求面积
{	
	
	Area=a*pow(R,2)/2.0+PI*pow(R,2);
	return Area;

}
double cone::setV(double R,double h,double a)   //求体积
{	
	 Volume=PI*pow(R,2)*h/3.0;
     return Volume;
}


void cone::print()const
{
	cout<<"圆锥表的面积为:"<<Area<<endl;
	cout<<"圆锥的体积为:"<<Volume<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -