 public class cylinder 
 {
 protected double height;
 protected circle c;

 public cylinder()
 {c=new circle(0.0,0.0,0.0);
  enterheight(0);}

 public cylinder( double h,circle d)
 {c=new circle(d);
  height=h;
 }
 
 public cylinder( double h, double r, double a, double b)
 {c=new circle(r,a,b);
  height=h;
 }
 
 public void enterheight (double h )
 { if(h>=0) height=h;
   else height=0; 
 } 

 public double readheight(){return height;}

 public double area()
 {return 2*c.area()+2*Math.PI*c.radius*height;} 

 public double volume(){return c.area()*height;}

 public String toString()
 {return c.toString()+";height = "+height;}

 public String name(){return "cylinder";}
}