Cody

Problem 44943. Calculate Amount of Cake Frosting

Solution 2988148

Submitted on 24 Sep 2020 by Abby Glenn
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
r = 3; h = 2; y_correct = 65.9734; assert(abs(func_frosting(r,h) - y_correct) < 1e-4)

top_circle_area = 28.2743 perim = 18.8496 side_area = 37.6991

2   Pass
r = 0.5; h = 0.25; y_correct = 1.5708; assert(abs(func_frosting(r,h) - y_correct) < 1e-4)

top_circle_area = 0.7854 perim = 3.1416 side_area = 0.7854

Suggested Problems

More from this Author13

Community Treasure Hunt

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

Start Hunting!