This is the Point class that my teacher gave me:
public class Point
{
private int x;
private int y;
public Point(int anX, int aY)
{
x = anX;
y = aY;
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
public String toString()
{
return "[" + x + ", " + y + "]";
}
}
And I think the LineSegment class would be like this:?
public class LineSegment
{
private Point p1;
private Point p2;
public LineSegment()
{
p1 = new Point();
p2 = new Point();
}
// i decided to add my own method here using the distance formula
public double getDistance(p1, p2)
{
return (Math.sqrt((Math.pow(2, (p1.getX()  p2.getX())) + (Math.pow(2,
p1.getY()  p2.getY() )));
}
}
Okay, so i guess thses are the classes for Point and LineSegment, although im very insecure about the LineSegment class that i made up.
Now that i have those done, i honestly still dont know how to use these classes properly for the Quadrilateral class.
All I have so far is "public class Quadrilateral" and the rest is a blur b/c i dont know how to complete it. I dont know what to do and its driving me nuts.
Going very much in right direction.
In the LineSegment class you did not provide a way of setting the points for that class. Can do this using setMethods or using a constructor
 public LineSegment(Point p1, Point p2)

{

this.p1 = new Point();

this.p2 = new Point();

}

Might also want to add getPoint1 and getPoint2 methods for that class.
Get distance sounds better as getLength().
The Quadrilateral class is now formed from the lines and points.
You can have several constructors for this class for all the different methods of forming a Quadrilateral
e.g


public Quadrilateral(LineSegment side1, LineSegment side2, LineSegment side3, LineSegment side4)
