First line contains , the number of test cases. Each test case contains ch, representing the choice as given in the problem statement.
When ch=1, Next line contains , length of the sides of the cube.
When ch=2, Next three lines contain , , representing length, breadth and height of the cuboid respectively. , , will be in three separate lines
When ch=3, Next line contains , the radius of the hemisphere
When ch=4, Next two lines contain , representing the radius and height of the cylinder respectively. , will be in two separate lines.
Note: You have to determine the data type of each parameter by looking at the code given in the main method.
There will be at most digits after decimal point in input.
For each test case, print the answer rounded up to exactly 3 decimal places in a single line. For example, 1.2345 should be rounded to 1.235, 3.12995 should be rounded to 3.130.
Sample Input 1
Sample Output 1
java.lang.NumberFormatException: All the values must be positive
There are two test cases. In the first test case , means you have to calculate the volume of a cube. The next line contains the =4, means the side of the cube is . So the volume of the cube is .
In the second test case, you have to calculate volume of a cylinder. But the height of the cylinder is negative, so an exception is thrown.