Weekly coding P3


Sat Jan 14 2023 14:29:48 GMT+0000 (Coordinated Universal Time)

Saved by @Shaghaf_2000 #python

# write aprogram to calculate the volune and surface area of a cuboid:
Take three inputs: 
1. height
2. width 
3. length 

height=float(input("Enter the height: "))
width=float(input("Enter the width: "))
length=float(input("Enter the length: "))

# print the given information in two decimal places:
print(f"Given h = {round(height,2)}, w = {round(width,2)}, l = {round(length,2)}")

# calculate the volume:
volume= height*width*length
print(f"The volume is {round(volume,2)}cm3")

# calculate the surface area:
surface= 2*length*width+2*length*height+2*height*width
print(f"The surface area is {round(surface,2)}cm2")