-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSimpleBox.java
More file actions
28 lines (24 loc) · 788 Bytes
/
SimpleBox.java
File metadata and controls
28 lines (24 loc) · 788 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
//Author : Deepansh Dubey.
//Date : 11/09/2021.
import java.io.*;
class SimpleBox
{
static int width, height, depth;
void Volume(int width, int height, int depth)
{
int vol= width*height*depth;
System.out.println("Volume = " + vol);
}
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Please enter the \nWidth\nHeight\nDepth");
width=Integer.parseInt(br.readLine());
height=Integer.parseInt(br.readLine());
depth=Integer.parseInt(br.readLine());
SimpleBox ob1=new SimpleBox();
SimpleBox ob2=new SimpleBox();
ob1.Volume(width,height,depth);
ob2.Volume(2,4,6);
}
}