Skip to content

Commit 6cb953b

Browse files
committed
Issue #5479 : added volume function in main folder and assert function in test folder under math/Volume
1 parent e0f4755 commit 6cb953b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/main/java/com/thealgorithms/maths/Volume.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static double volumeCone(double radius, double height) {
7272
/**
7373
* Calculate the volume of a prism.
7474
*
75-
* @param baseArea area of the given prism's base
75+
* @param baseArea area of the given prism's base
7676
* @param height of given prism
7777
* @return volume of given prism
7878
*/
@@ -83,27 +83,23 @@ public static double volumePrism(double baseArea, double height) {
8383
/**
8484
* Calculate the volume of a pyramid.
8585
*
86-
* @param baseArea of the given pyramid's base
86+
* @param baseArea of the given pyramid's base
8787
* @param height of given pyramid
8888
* @return volume of given pyramid
8989
*/
9090
public static double volumePyramid(double baseArea, double height) {
9191
return (baseArea * height) / 3;
9292
}
9393

94-
9594
/**
9695
* Calculate the volume of a pyramid.
9796
*
98-
* @param r1 radius of top of frustum
99-
* @param r2 radius of bottom of frustum
97+
* @param r1 radius of top of frustum
98+
* @param r2 radius of bottom of frustum
10099
* @param height of given frustum
101-
* @return volume of given frustum
100+
* @return volume of given frustum
102101
*/
103102
public static double volumeFurstumOfCone(double r1, double r2, double height) {
104103
return ((Math.PI * height) / 3) * (r1 * r1 + r2 * r2 + r1 * r2);
105104
}
106-
107-
108-
109105
}

0 commit comments

Comments
 (0)