Demo entry 6719689

c++

   

Submitted by anonymous on Mar 13, 2018 at 13:05
Language: C++. Code size: 462 Bytes.

class cone :public cylinder{
private :
	double r,h, l;
public:
	const double PI = 3.14159265358979323846;
	cone(double r, double l,double h){
		this->r = r;
		this->l = l;
		this->h = h;
	}
	double getBottomArea() {
		return PI * r*r;
	}
	double getAllArea() {
		return getBottomArea() + PI * this->r*this->l;
	}
	double getVolume() {
		return getBottomArea()*this->h / 3;
	}
	double getCircumference() {
		return PI * this->r * 2;;
	}

};

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).