
Tanya M. answered 11/26/23
Computer Science Tutor
I am writing a rough sketch of your code output as I don't know the full extent of the assignment, but I hope this helps!
public Point2D copyOf()
{
Point2D newPoint = new Point2D(0,0);
return newPoint;
}
public Point2D add(Point2D other)
{
new_x = x + other.x;
new_y = y + other.y;
Point2D final = new Point2D(other_x,other_y);
return final;
}
public Point2D midpoint(Point2D other)
{
new_x2 = (x + other.x)/2;
new_y2 =(y + other.y)/2;
Point2D final2 = new Point2D(other_x,other_y);
return final2;
}