subject

You have been asked to extend the Point class that represents 2-D (x, y) coordinates. The Point class includes the following public constructors and methods Method/Constructor Description public Point() public Point (int x, int y) public void setLocation(int x, int y) sets the coordinates to the given values public int getx() public int gety() public String toString() public double distanceFronOrigin() | returns the distance from the origin (e, θ) computed as the square root of (x2 + y2) constructs the point (e, e) constructs a point with the given xly coordinates returns the x-coordinate returns the y-coordinate returns String in standard"(x, y)" notation You are to define a new class called Point3D that extends this class through inheritance. It should behave like a Point except that it should be a 3-dimensional point that keeps track of a z-coordinate. You should provide the same methods as the superclass, as well as the following new behavion Method/Constructor Description public Point3D() public Point3D(int x, int y, int z) public void setLocation(int x, int y, int z) sets the coordinates to the given values public int getz() constructs the point (e, e, e) constructs a point with the given xly/z coordinates returns the z-coordinate Some of the existing behaviors from Point should behave differently on Point3D objects . When the original 2-parameter version of the setLocation is called, the 3-D point's x/y coordinates should be set as specified, and the z-coordinate should be set to e . When a 2-D point is printed with toString, it should be returned in an "(x, y, z)" format that shows all three coordinates . A 3-D point's distance from the origin is computed using all three coordinates, it is equal to the square root of (x2 +y2 + z'2) You must also make Point3D objects comparable to each other using the Comparable interface. 3-D points are compared by x-coordinate, then by y-coordinate, then by z-coordinate. In other words, a Point 3D object with a smaller x-coordinate is considered to be "less than" one with a larger x-coordinate. If two Point3D objects have the same x-coordinates, the one with the lower y-coordinate is considered "less". If they have the same x and y-coordinates, the one with the lower z-coordinate is considered "less". If the two points have the same x, y, and z-coordinates, they are considered to be "equal"

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
An attribute on a webpage allows you to set borders and change background colors. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
You know the right answer?
You have been asked to extend the Point class that represents 2-D (x, y) coordinates. The Point clas...
Questions
question
English, 09.09.2019 16:10
Questions on the website: 13722360