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

1 Expert Approved Answer
Step: 1 Unlock

media pointerfileservicefile9bdd7xNgi6x97nTeYyUcQd Question pleas... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!