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 commentsGroup

MATLAB JOINT CODY EVENT 2024
- 20 Problems
- 10 Finishers
- Slope intercept application
- findPositiveEvenNumbers
- Hemisphere Volume on Top of a Cylinder
- area
- Return area of square
- Potential energy calculation
- Volume and area of a sphere
- Create the following sequence : 0 1 1 4 9 25 64 169 ...
- Unique - Very Very Large Numbers
- Sum of series
- "mirror" matrix
- Pernicious Anniversary Problem
- Find Logic 20
- Remove element(s) from cell array
- Matlab Basics - Rounding II
- It dseon't mettar waht oedrr the lrettes in a wrod are.
- Are all the three given point in the same line?
- Is the Point in a Triangle?
- Counting Sequence
- Word Counting and Indexing
Problem Recent Solvers45
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!