Question: please use java textpad Exercise 1.1 Submit Assignment Due Feb 3 by 11:59pm Points 10 Submitting a text entry box or a file upload In
please use java textpad
Exercise 1.1 Submit Assignment Due Feb 3 by 11:59pm Points 10 Submitting a text entry box or a file upload In a package called shape, create a Sphere class and a Sphere Driver Class. Your Sphere Driver should demonstrate creating a Sphere object and using it to invoke the Sphere methods. Your Sphere class should have the following: Class variable diameter that has a private visibility A constructor without parameters that sets diameter to a default of 1 A setDiameter(int diameter) method that sets the parameter's diameter to the classes diameter (you must use this) A getDiameter() method that returns the diameter A getVolume() method that return the volume of a sphere A getSurfaceArea() method that return the surface area of a sphere A toString method that returns a string representation of the Sphere. You should round to the second decimal place. Ex: A sphere with a diameter of 4 has a volume of 33.51 and a surface area of 50.27
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
