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

📄 cylinder.cpp

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

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

⌨️ 快捷键说明

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