import java.io.*;
class Volume
{
void claculateVolume(int s)
{
int vol=0;
vol=s*s*s;
System.out.println("The Volume of a Cube is : "+vol);
}
void claculateVolume(double r,double h)
{
double pi=3.1428;
double vol=0.0;
vol=pi*r*r*h;
System.out.println("The Volume of a Cylinder is : "+vol);
}
void claculateVolume(double a)
{
double pi=3.1428;
double b=(4.0/3.0);
double c=b*pi;
double vol=0.0;
double d=a*a*a;
vol=c*d;
System.out.println("The Volume of a Sphere is : "+vol);
}
}
class Main
{
public static void main(String args[])
{
boolean i=true;
Volume v=new Volume();
int ch=0;
int s=0;
double r=0.0,h=0.0,a=0.0;
try
{
System.out.println("\n\nEnter\n\n1. To Calculate Volume Of Cube\n\n2. To Calculate Volume Of Cylinder\n\n3. To Calculate Volume Of Sphere");
System.out.println("Enter Your Choice.....");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
ch=Integer.parseInt(br.readLine());
}
catch(Exception e)
{
System.out.println(e);
}
switch(ch)
{
case 1:
try
{
System.out.println("Enter The side of a Cube.........");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
s=Integer.parseInt(br.readLine());
}
catch(Exception e)
{
System.out.println(e);
}
v.claculateVolume(s);
break;
case 2:
try
{
System.out.println("Enter The radius of a Cylinder.........");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
r=Integer.parseInt(br.readLine());
System.out.println("Enter The height of a Cylinder.........");
h=Integer.parseInt(br.readLine());
}
catch(Exception e)
{
System.out.println(e);
}
v.claculateVolume(r,h);
break;
case 3:
try
{
System.out.println("Enter The radius of a Sphere.........");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
a=Integer.parseInt(br.readLine());
}
catch(Exception e)
{
System.out.println(e);
}
v.claculateVolume(a);
break;
default:
System.out.println("Invalid Input");
break;
}
}
}