Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46cb2ac

Browse files
committed
Completed the total Surfarea and Volume problem
1 parent 2755c1d commit 46cb2ac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Maths/Surface_Area_Volume_of_Box.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Write a function that returns the total surface area and volume of a box as an array: [area, volume]
2+
3+
function getSize(width, height, depth) {
4+
const volume = width * height * depth;
5+
const totalSurfaceArea =
6+
2 * (depth * height + width * depth + width * height);
7+
8+
return [totalSurfaceArea, volume];
9+
}

0 commit comments

Comments
 (0)