public class Cube{
private double width;
private double length;
private double height;
private double volume;
private double area;
public Cube(double w,double h,double l)
{
width=w;
height=h;
length=l;
}
public Cube()
{
}
private double volume()
{
return=width*length*height;
}
private double area()
{
return=width*length;
}
public void Dimension(double nLength, double nHeight, double nWidth)
{
length=nLength;
width=nWidth;
height=nHeight;
}
public void displayCube()
{
System.out.println("The volume of the Cube:"+volume());
System.out.println("the area of the Cube:"+area());
}
}
Friday, March 20, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment