A line segment is the part of a line between two points. Two things are asked about it: how long it is and where its middle is.
For the length, think of the segment as the longest side of a right-angled triangle. The other two sides are the difference in the x-coordinates and the difference in the y-coordinates. Pythagoras' theorem then gives the length.
The midpoint is halfway along, so its coordinates are the averages of the two x-coordinates and of the two y-coordinates. If you know the midpoint and one end, go the same step again to reach the other end.