7 kyu
Volume of a cup
664 of 1,214tdowek1
Description:
Your job is to return the volume of a cup when given the diameter of the top, the diameter of the bottom and the height.
You know that there is a steady gradient from the top to the bottom.
You want to return the volume rounded to 2 decimal places.
Exmples:
cup_volume(1, 1, 1)==0.79
cup_volume(10, 8, 10)==638.79
cup_volume(1000, 1000, 1000)==785398163.4
cup_volume(13.123, 123.12, 1)==4436.57
cup_volume(5, 12, 31)==1858.51
You will only be passed positive numbers.
Geometry
Fundamentals
Similar Kata:
Stats:
Created | Jan 21, 2016 |
Published | Jan 22, 2016 |
Warriors Trained | 2603 |
Total Skips | 104 |
Total Code Submissions | 3301 |
Total Times Completed | 1214 |
JavaScript Completions | 490 |
CoffeeScript Completions | 15 |
Ruby Completions | 102 |
Python Completions | 664 |
Total Stars | 43 |
% of votes with a positive feedback rating | 83% of 198 |
Total "Very Satisfied" Votes | 144 |
Total "Somewhat Satisfied" Votes | 39 |
Total "Not Satisfied" Votes | 15 |