Problem 58758. Hemisphere Volume on Top of a Cylinder
This MATLAB function has to calculate the volume of a hemisphere placed on top of a cylinder, given valid inputs. It takes the radius of the cylinder and the height of the cylinder as input, and returns the total volume of the hemisphere and the cylinder combined.
Solution Stats
Problem Comments
-
2 Comments
ChrisR
on 19 Jul 2023
@chiarad: Please check the answers in the test suite. I think the solution you submitted computes the correct volumes, but the volumes in the tests are incorrect.
Also, the tests should have an assert statement--something like assert(abs(expectedResult-volume)<1e-6). Otherwise, just about anything will pass.
goc3
on 2 Dec 2023
The test suite has been fixed.
Solution Comments
Show commentsProblem Recent Solvers44
Suggested Problems
-
Return a list sorted by number of occurrences
2778 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
372 Solvers
-
Basics: 'Find the eigenvalues of given matrix
416 Solvers
-
the average value of the elements
1577 Solvers
-
1670 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!