GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add triangular prism surface area calculation by JMullin-06 · Pull Request #7695 · TheAlgorithms/Java

Conversation

@JMullin-06

@JMullin-06 JMullin-06 commented Oct 29, 2026

Copy link
Copy Markdown

Description

Adds a method to calculate the surface area of a triangular prism with a right-triangle base to the Area class.

Changes

  • Added surfaceAreaTriangularPrism() to calculate the total surface area using the two perpendicular sides of the triangular base and the prism length.
  • Added input validation to reject non-positive dimensions.
  • Included JavaDoc documentation for the method and its parameters.
  • Added correct argument exception to 'surfaceAreaPyramid()'

Formula

For perpendicular sides (a) and (b), and prism length (L):

[
SA = ab + L(a+b+\sqrt{a^2+b^2})
]

##Testing

Added a test using sides 3 and 4 and prism length 10, expecting a surface area of 132.0.
Added tests for zero and negative input values.

Checklist

  • Code follows the repository's style guidelines.
  • Unit tests pass.
  • No unrelated changes are included.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JMullin-06 added 2 commits October 29, 2026 15:45
@JMullin-06
Added surface area calculation for triangular prism, and fixed Illega…
e540c1b
…lArgumentException for surface area calculation for pyramid
@JMullin-06
Variable name error change
9eeabbc
@JMullin-06
JMullin-06 requested review from DenizAltunkapan, alxkm and yanglbme as code owners October 29, 2026 20:05
@codecov-commenter

codecov-commenter commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.22%. Comparing base (2319794) to head (4002d5a).

Files with missing lines Patch % Lines
src/main/java/com/thealgorithms/maths/Area.java 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7695      +/-   ##
============================================
- Coverage     82.22%   82.22%   -0.01%     
- Complexity     8403     8405       +2     
============================================
  Files           843      843              
  Lines         26141    26151      +10     
  Branches       5100     5102       +2     
============================================
+ Hits          21495    21503       +8     
  Misses         3854     3854              
- Partials        792      794       +2     

☔ 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JMullin-06
Formatting Errors
4002d5a
@JMullin-06
JMullin-06 marked this pull request as draft October 29, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DenizAltunkapan DenizAltunkapan Awaiting requested review from DenizAltunkapan DenizAltunkapan is a code owner
@yanglbme yanglbme Awaiting requested review from yanglbme yanglbme is a code owner
@alxkm alxkm Awaiting requested review from alxkm alxkm is a code owner

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JMullin-06 @codecov-commenter
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.