7 kyu
Building Spheres
2,322 of 3,070NaMe613
Description:
Now that we have a Block let's move on to something slightly more complex: a Sphere
.
Arguments for the constructor
radius -> integer or float (do not round it)
mass -> integer or float (do not round it)
Methods to be defined
get_radius() => radius of the Sphere (do not round it)
get_mass() => mass of the Sphere (do not round it)
get_volume() => volume of the Sphere (rounded to 5 place after the decimal)
get_surface_area() => surface area of the Sphere (rounded to 5 place after the decimal)
get_density() => density of the Sphere (rounded to 5 place after the decimal)
Example
ball = Sphere(2,50)
ball.get_radius() -> 2
ball.get_mass() -> 50
ball.get_volume() -> 33.51032
ball.get_surface_area() -> 50.26548
ball.get_density() -> 1.49208
Any feedback would be much appreciated
Object-oriented Programming
Fundamentals
Similar Kata:
Stats:
Created | Aug 5, 2015 |
Published | Aug 5, 2015 |
Warriors Trained | 4574 |
Total Skips | 188 |
Total Code Submissions | 9249 |
Total Times Completed | 3070 |
Python Completions | 2322 |
C# Completions | 774 |
Total Stars | 61 |
% of votes with a positive feedback rating | 91% of 454 |
Total "Very Satisfied" Votes | 382 |
Total "Somewhat Satisfied" Votes | 58 |
Total "Not Satisfied" Votes | 14 |
Total Rank Assessments | 79 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |