Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7670 +/- ##
=========================================
Coverage 82.21% 82.22%
- Complexity 8401 8403 +2
=========================================
Files 843 843
Lines 26141 26141
Branches 5100 5100
=========================================
+ Hits 21493 21495 +2
Misses 3854 3854
+ Partials 794 792 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
FarhanQ19
left a comment
There was a problem hiding this comment.
Self-review completed for this individual lab. I checked input validation, the surface-area calculation, and variable declarations. Area.java compiled successfully with exit code 0; automated tests were not run.
| if (slantHeight <= 0) { | ||
| throw new IllegalArgumentException("slant height must be greater than 0"); | ||
| throw new IllegalArgumentException( | ||
| "slant height must be greater than 0"); |
There was a problem hiding this comment.
Self-review: The slant-height check rejects zero and negative values. Automated tests should verify that both cases throw IllegalArgumentException.
| double baseArea = sideLength * sideLength; | ||
| double lateralSurfaceArea = 2 * sideLength * slantHeight; | ||
|
|
||
| final double baseArea = sideLength * sideLength; |
There was a problem hiding this comment.
Self-review: Declaring the calculation variables final makes it clear that they are not reassigned. The surface-area formula remains unchanged.
Updated surfaceAreaPyramid to provide a descriptive error message for invalid side lengths and declared the calculation variables final.
Verified that Area.java compiles successfully using javac with exit code 0. No automated tests were run.