Question: please i want to solve this program intermediate programming with objects (java language urgent). Part I: Implement the following classes Consider the following UML diagram
Part I: Implement the following classes Consider the following UML diagram for an application that manages spheres in the 3D space. Sphere Point -radius: double -center: Point -color: String +Sphere) +Sphere (radius: double, center: Point, color: String) +getCenter():Point +calculate Volume(): double +isEqual(sphere:Shpere):boolean +toString(): String Question 1: -x: double -y: double -2: double +Point) +Point(x: double, y: double, z: double) calculate Distance(point:Point) :double +isEqual(point : Point) :boolean +toString(): String Create the class Point Implement the no-arg and all-arg constructors. Implement the calculateDistance method that returns the distance between two points. - Implement the isEqual method that returns true if all coordinates are equal in both points and false otherwise. - Implement the toString() method. If x=2.0, y=3.5, and z-4.0, then the method returns a string in the form: (2.0, 3.5, 4.0) Question 2: Create the class Sphere Implement the two constructors. The no-arg constructor should initialize the color to "black", the radius to 1.0, and the center to (0.0, 0.0, 0.0). Implement the getCenter method that returns the center of the sphere. Don't implement the rest of getters and setters. Implement the method calculateVolume() that returns the volume of the sphere
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
