I am trying to write a program that will give me the volume of a cylinder when I run it. I already have a Circle class that computes the area of a circle. I am also using a seperate program to handle the input and output. Could someone tell me what I am doing wrong with my program?
public class Cylinder
{
// calls up and creates an object from the Circle class
Private Circle base;
Private double Height;
//Constructor
Public Cylinder(double h, double r)
{
// creates object from cirle class
Circle base = new circle(r);
height = h;
}
public double getVolume()
{
return CircleBase.area * height;
}
}