Volume of various solids
| class Volume
{
double VOLUMEofCUBE (double side)
{
return side*side*side;
}
double VOLUMEofSPHERE (double radius)
{
return 4.0/3*22/7*radius*radius*radius;
}
double VOLUMEofCUBOID(double l, double b, double h)
{
return l*b*h;
}
double VOLUMEofCYLINDER(double radius, double height)
{
return 22/7*radius*radius*height;
}
double VOLUMEofCONE(double radius, double height)
{
return 1/3*22/7*radius*radius*height;
}
}
|
No comments:
Post a Comment