Java Program to Find the Volume and Surface Area of Cuboid
A Cuboid is a 3-dimensional box-like figure represented in the 3-dimensional plane. A cuboid has 6 rectangle-shaped faces. Each face meets another face at 90 degrees each. Three sides of cuboid meet at the same vertex. Since it is made up of 6 rectangle faces, it has length, width and height of different dimension. Given the dimensions of the cuboid, find the Surface area and Volume of a cuboid. The formula’s to calculate the area and volume are given below.
Input : 20 15 10 Output : Surface Area = 1300 Volume = 3000 Input : 30 5 10 Output : Surface Area = 1000 Volume = 1500
Volume = length * breadth * height
Surface Area of Cuboid = 2(length * breadth + breadth * height + height * length)
- Given the dimensions of the cone, say length L, height H and breadth B of a cuboid.
- Calculate Volume and Surface Area
The Surface area of cuboid is : 1300.0 The Volume of the cuboid is : 3000.0
Time Complexity: O(1) as it is doing constant operations
Space Complexity: O(1)
The Surface area of cuboid is : 1000.0 The Volume of the cuboid is : 1500.0
Time Complexity: O(1) as constant operations are performed
Space Complexity: O(1) since using constant variables