Computer Science, asked by fatimashaheen035, 8 months ago

write the function to calculate the volume of box which making us the following parameter 1 length of the box with the box and height of the box the user can calculate the volume until the user wish to terminate in python

Answers

Answered by Anonymous
1

Answer:

Cuboid is a 3-dimensional box-like figure represented in the 3-dimensional plane.Cuboid has 6 rectangled-shape faces. Each face meet another face at 90 degree each.Three sides of cuboid meet at same vertex.Since it is made up of 6 rectangle faces, it have length, width and height of different dimension.

Input : 2 3 4

Output : Area = 24

        Total Surface Area = 52  

 

Input : 5 6 12

Output : Area = 360

        Total Surface Area = 324

# Python3 code to find volume and  

# total surface area of cuboid  

 

# utility function  

def volumeCuboid( l , h , w ):  

   return (l * h * w)  

     

def surfaceAreaCuboid( l , h , w ):  

   return (2 * l * w + 2 * w * h + 2 * l * h)  

 

# driver function  

l = 1

h = 5

w = 7

print("Volume =" , volumeCuboid(l, h, w))  

print("Total Surface Area =", surfaceAreaCuboid(l, h, w))  

 

#This code is contributed by "Sharad_Bhardwaj".

Output :

Area = 35

Total Surface Area = 94

Similar questions