Question: Java plz!!!!!!!!!!!Java!!!! Sphere class (methods implementation) Complete the code for the class Sphere. Assume that the getter/setter methods are already implemented. You have to implement
Java plz!!!!!!!!!!!Java!!!!

Sphere class (methods implementation)
Complete the code for the class Sphere. Assume that the getter/setter methods are already implemented. You have to implement the following methods (follow specifications as if they were written in UML class diagram): + getArea(): double -> it calculates the area of the sphere (please use the constant PI defined in the class for this) + getVolume(): double -> it calculates the volume of the sphere (please use the constant PI defined in the class for this) + pointInSphere(xPoint: int, yPoint:int, zPoint: int): boolean -> it checks if the points with given coordinates xPoint, yPoint and zPoint is contained inside the sphere (Hint: get the Euclidean distance between the center of the sphere and the point and check if it is greater than the sphere's radius or not. Using sqrt and pow methods from Math class could be helpful here.) More instructions on how to implement the missing parts of this class are provided in the code below.
Sphere class (methods implementation) Complete the code for the class Sphere. Assume that the getter setter methods are already implemented. You have to implement the following methods (follow specifications as if they were written in UML class diagram): + getArea(): double -> it calculates the area of the sphere (please use the constant Pl defined in the class for this) + getVolume(): double -> it calculates the volume of the sphere (please use the constant PI defined in the class for this) + pointinSphere(xPoint: int, yPoint:int, zPoint: int): boolean -> it checks if the points with given coordinates XPoint, yPoint and zPoint is contained inside the sphere (Hint: get the Euclidean distance between the center of the sphere and the point and check if it is greater than the sphere's radius or not. Using sqrt and pow methods from Math class could be helpful here.) More instructions on how to implement the missing parts of this class are provided in the code below. 2 3 1 public class Sphere //class attributes private int x; 4 private int y private int z: private int radius: 7 8 final double PI = 3.14; 5 6 9 10 11 public Sphere of x=0: y=0); 12 13 z=0 14 15 radius=1; } //Define the methods getrea, getVolume, pointInSphere 16 17 18 ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
