Answer:
If you're given a set of coordinates that Gracie has travelled to, you can find the farthest in each direction with something like this (I'll use pseudocode in lieu of a specified language):
left = right = top = bottom = null
for each location traveled{
if left == null or location.x < left {
left = location.x
}
if right == null or location.x > right {
right = location.x
}
// note that I'm assuming that the vertical position increases going downward
if top == null or location.y < top {
top = location.y
}
if bottom == null or location.y > bottom {
bottom = location.y
}
}
As for the four print statements and other information, insufficient information is provided to complete that.