谁指点一下下面的程序,,,,好郁闷的...谢谢..
#include<iostream.h>
class cylinder{
public:
cylinder ( double x,double y);
double get_volume ( double x,double y);
void vol ( );
private:
double radius,height;
double volume;
};
double cylinder::cylinder ( double x,double y){
radius=x; height=y;
}
double cylinder::get_volume ( double x,double y)
{
return volume=3.14*x*x*y;
}
void cylinder::vol ( )
{
cout<<"volume="<<volume<<endl;
}
void main(){
cylinder ob (2.0,3.0);
ob.vol();
}
请把你们的高见写下来...