定义一个圆类,计算圆的面积和周长,用成员函数
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 19:01:23
用java语言描述:publicclassCircle{privatedoubleRadius;//半径publicCircle(){}publicCircle(doubleradius){Radiu
周长:形成整个圆的那条曲线的长度叫圆的周长.面积:组成员的那条曲线中的面积,就是圆的面积.
namespaceEX1_4{publicclassshape{publicdoublePI=3.14;}publicclassRectangle:shape{publicintx,y,s,l;pub
#include#includeusingnamespacestd;classCircle{doubler,Area,Circumference;public:Circle(doublea=0);Ci
classCircle{public:Circle(intnr){r=nr;}Circle(){}public:intr;intArea(){return3.14*r*r;}};classB{publ
http://zhidao.baidu.com/link?url=2LwKWCWcipJauzyzIX52Pphwyvt116QrX2PkeaiAcKjPhe97IbPqCWZCwpbC94DwfNw
#includeusingnamespacestd;classcircle{private:doubleradius;public:circle(doubler=0.0);voidinput();do
Java的行不,C++的不记得了.publicclassCircle{privatestaticdoublePI=3.14privatedoubleradius;publicCircle(double
#includeclassCircle{public:Circle():radius(0){}Circle(doubler):radius(r){}constdoublearea()co
以下程序,直接拿去交作业吧,都测试过了.//圆周长面积#include#definepi3.14159classcircle{public:voidsetRadius(){std::cout
类似的问题,在知道里面不知道有多少.搜索一下.
#includeusingnamespacestd;#definePI3.14classPoint{public:\x09Point():m_x(0),m_y(0){}\x09Point(double
#include"stdafx.h"#include#includeusingnamespacestd;classCircle{doubler,Area,Circumference;public:Ci
usingSystem;classRectangle{privateintwidth;privateintheight;publicRectangle(intw,inth){width=w;heigh
#includeusingnamespacestd;classCircle{public:Circle(doubler=0):radius(r){}doubleArea(){return3.14*ra
classcircle{doublerd;//半径成员public:circle(){rd=0.0;}//构造函数cirle(doubleb){rd=b;}//重构构造函数doublezc(){ret
这个是pascal的做法programabcconstpai=3.14varR,Area:real;beginwriteln("pleaseinputanumberforr:");readln(r);
#includeusingnamespacestd;#definepi3.14classcircle{public:circle(doubler=0.0){}circle(circle&c){}dou
不要提出这种问题,代码还是自己动手写的好,写的过程中遇到麻烦,再拿出来问的话,我想会有更多人乐意帮你解答的再问:来不及哦!!今天晚上要交!!没时间慢慢写!!我对c++也不是很熟!急求高手流利的给个程序
#include#include#includeusingnamespacestd;classTriangle{inta,b,c;public:doubleArea(){doubles=(a+b+c)