Skip to content

Added surface area calculation for pyramid - #7701

Open
mkuttempp wants to merge 1 commit into
TheAlgorithms:masterfrom
mkuttempp:new_branch
Open

mkuttempp wants to merge 1 commit into
TheAlgorithms:masterfrom
mkuttempp:new_branch

Conversation

@mkuttempp

Copy link
Copy Markdown
  • 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 algorithms include a corresponding test class that validates their functionality.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Description: Added a new method called surfaceAreaPyramid to the Area class.
The method calculates the surface area of a pyramid with a square base using the side length and slant height.
Added input validation to ensure both values are positive before performing the calculation.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.23%. Comparing base (410f087) to head (cbd67c9).

Files with missing lines Patch % Lines
src/main/java/com/thealgorithms/maths/Area.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7701      +/-   ##
============================================
+ Coverage     82.22%   82.23%   +0.01%     
- Complexity     8402     8405       +3     
============================================
  Files           843      843              
  Lines         26143    26143              
  Branches       5101     5101              
============================================
+ Hits          21495    21498       +3     
  Misses         3854     3854              
+ Partials        794      791       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

*
* @param sideLength side length of the square base
* @param slantHeight slant height of the pyramid
* @return surface area of the given pyramid

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

code comment line

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