-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathS.java
More file actions
32 lines (31 loc) · 920 Bytes
/
Copy pathS.java
File metadata and controls
32 lines (31 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package switchprograms;
import java.io.*;
public class S
{
public static void main()throws IOException
{
BufferedReader ob=new BufferedReader(new InputStreamReader(System.in));
System.out.println("1.volume of cube");
System.out.println("2.volume of cuboid");
int ch=Integer.parseInt(ob.readLine());
double v=1.0;
switch(ch)
{
case 1:
System.out.println("enter side");
double r=Double.parseDouble(ob.readLine());
v=r*r*r;
System.out.println(v);
break;
case 2:
System.out.println("enter l and b");
double l=Double.parseDouble(ob.readLine());
double b=Double.parseDouble(ob.readLine());
double h=Double.parseDouble(ob.readLine());
v=l*b*h;
System.out.println(v);
break;
default:
}
}
}