Skip to content

Commit 8e2bbc0

Browse files
committed
Fix pyramid slant height error message
1 parent ce6a697 commit 8e2bbc0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • src/main/java/com/thealgorithms/maths

‎src/main/java/com/thealgorithms/maths/Area.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public static double surfaceAreaSphere(final double radius) {
7777
* @return surface area of the given pyramid
7878
*/
7979
public static double surfaceAreaPyramid(final double sideLength, final double slantHeight) {
80-
if (sideLength <= 0) {
81-
throw new IllegalArgumentException("Must be a positive sideLength");
82-
}
83-
if (slantHeight <= 0) {
84-
throw new IllegalArgumentException("slant height must be greater than 0");
85-
}
80+
if (sideLength <= 0) {
81+
throw new IllegalArgumentException("Must be a positive sideLength");
82+
}
83+
if (slantHeight <= 0) {
84+
throw new IllegalArgumentException("Must be a positive slantHeight");
85+
}
8686
double baseArea = sideLength * sideLength;
8787
double lateralSurfaceArea = 2 * sideLength * slantHeight;
8888
return baseArea + lateralSurfaceArea;

0 commit comments

Comments
 (0)