Cody

# Problem 44618. surface areas of a cylinder

Solution 2989021

Submitted on 25 Sep 2020 at 1:56
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
optn=1; r=3; h=6; y_correct = 36*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

2   Pass
optn=5; r=3; h=6; y_correct = 18*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

3   Pass
optn=2; r=2; h=2; y_correct = 16*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

b = 50.2655 ans = 16

4   Pass
optn=0; r=5; h=10; y_correct = 50*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

5   Pass
optn=1; r=5; h=10; y_correct = 100*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

6   Pass
optn=2; r=5; h=10; y_correct = 150*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

b = 471.2389 ans = 150

7   Pass
optn=42; r=3; h=7; y_correct = 18*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

8   Fail
optn=2; r=3 h=7; y_correct = 60*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

r = 3 b = 188.4956 ans = 60.0000

Assertion failed.

9   Pass
optn=1; r=3; h=7; y_correct = 42*pi; assert(isequal(surface_area_cyl(optn,r,h),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!