I'll show you how to do the first exercises of both types, the others are identical.
Find the midpoint: A=(-2,-3), B=(8,-7)
The coordinates of the midpoint are the average of the correspondent coordinates, so we have

Find the endpoint
We simply have to reverse the previous logic: since

we have

and the same goes for
.
So, we have

