getting strange print out for calculation of volume

// DEBUG3-4
// This program contains a class for a cylinder
// Data members are radius and height
// The volume is calculated as pi times radius squared times height
// If no height is given, it's not a cylinder - it's a circle!

using namespace std;
//declaration section

class Cylinder
double radius;
double height;
static double pi;
double volume;
Cylinder(const double r);
Cylinder(const double r, const double h);
void showData(void);
double convert(void);

double Cylinder::pi=3.1459;

// implementation section
Cylinder::Cylinder(const double r)

cout<<"This is a circle - It has no volume!!"<<endl;
Cylinder::volume = convert();

Cylinder::Cylinder(const double r, const double h)
Cylinder::radius = r;
Cylinder::height = h;
Cylinder::volume = h* r;

double Cylinder::convert(void)
double vol;
volume = pi * (Cylinder::radius * Cylinder::radius) * Cylinder::height;

void Cylinder::showData(void)
cout<<"Cylinder is "<<Cylinder::radius<<" by "<<Cylinder::height;
cout<<" Volume is "<<Cylinder::volume<<" "<<endl<<endl;

int main()
Cylinder oneCylinder(3,5);
Cylinder oneCircle(8);
┬┐what's strange?
Topic archived. No new replies allowed.