Question: In a package called shape , create a Sphere class and a SphereDriver Class (UPDATE: you do not NEED to make a separate driver class
In a package called shape, create a Sphere class and a SphereDriver Class (UPDATE: you do not NEED to make a separate driver class but can if it helps). Your Sphere Driver should demonstrate creating a Sphere object and using it to invoke the Sphere methods. Your Sphere class should have the following:
Create a class called Sphere.
Its __init__() method should take self, and diameter as arguments. Make sure to set these appropriately in the body of the __init__()method.
Create a method named volume that returns the volume of the sphere calculated from the diameter
Create a variable named surface_area that returns the surface area of the sphere calculated from the diameter
Create a variable named my_sphere and set it equal to a new instance of your Sphere class. Pass it a diameter (Ex: 4).
Print out volume and surface_area
*In python please
Step by Step Solution
There are 3 Steps involved in it
media pointerfileservicefile9bdd7xNgi6x97nTeYyUcQd Question pleas... View full answer
Get step-by-step solutions from verified subject matter experts
