编程小白实在看不出还有哪有错了,求大神指导
[Error] no matching function for call to 'Cylinder::Cylinder(double&, double&)'
#include<iostream>
using namespace std;
class Cylinder
{
public:
double area;
double volume;
void cylinder();
void cylinder(double,double);
void computeArea( );
void computeVolume( );
void printCylinder( );
private:
double radius;
double height;
};
void Cylinder::cylinder()
{
area=0;
volume=0;
height=1;
radius=2;
}
void Cylinder::cylinder(double h,double r)
{
height=h;
radius=r;
area=0;
volume=0;
}
void Cylinder::computeArea()
{
area=2*3.14*radius*radius+2*3.14*radius*height;
}
void Cylinder::computeVolume()
{
volume=3.14*radius*radius*height;
}
void Cylinder::printCylinder()
{
cout<<"area="<<area<<endl;
cout<<"vloume="<<volume<<endl;
}
int main()
{
double r,h;
cout<<"请输入r"<<endl;
cin>>r;
cout<<"请输入h"<<endl;
cin>>h;
Cylinder aa(r,h);
aa.computeArea();
aa.computeVolume();
aa.printCylinder();
return 0;
}