Skip to content

Conversation

@Marko411
Copy link

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

I added the following function for calculating the area of a pyramid in the area calculation methods part of the code

/**

  • Calculate the surface area of a pyramid with a square base.
  • @param sideLength side length of the square base
  • @param slantHeight slant height of the pyramid
  • @return surface area of the given pyramid
    */
    public static double surfaceAreaPyramid(final double sideLength, final double slantHeight) {
    if (sideLength <= 0) {
    throw new IllegalArgumentException("Must be a positive sideLength");
    }
    if (slantHeight <= 0) {
    throw new IllegalArgumentException("Must be a positive slantHeight");
    }
    double baseArea = sideLength * sideLength;
    double lateralSurfaceArea = 2 * sideLength * slantHeight;
    return baseArea + lateralSurfaceArea;
    }

}


/**
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to add a comment on line 198

Copy link
Author

@Marko411 Marko411 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my review is done

@DenizAltunkapan
Copy link
Member

solved in #6853

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants