Skip to content

Commit c71f2d1

Browse files
committed
Update Area.java
1 parent 53a7e18 commit c71f2d1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ public static double surfaceAreaCone(final double radius, final double height) {
243243
*/
244244
public static double surfaceAreaPyramid(final double sideLength, final double slantHeight) {
245245
if (sideLength <= 0) {
246-
throw new IllegalArgumentException("Must be a positive sideLength");
246+
throw new IllegalArgumentException("Must be a positive sideLength");
247247
}
248248
if (slantHeight <= 0) {
249-
throw new IllegalArgumentException("Must be a positive slantHeight");
249+
throw new IllegalArgumentException("Must be a positive slantHeight");
250250
}
251-
double baseArea = sideLength * sideLength;
252-
double lateralSurfaceArea = 2 * sideLength * slantHeight;
253-
return baseArea + lateralSurfaceArea;
251+
double baseArea = sideLength * sideLength;
252+
double lateralSurfaceArea = 2 * sideLength * slantHeight;
253+
return baseArea + lateralSurfaceArea;
254254
}
255255
}

0 commit comments

Comments
 (0)