The slope of the line given is 1 because that is the coefficient in front of x. A slope is found by dividing the change in y by the change in x. Knowing this, we can set up an equation with the points given.
1 = (-2 - k)/(-7 +1)
Now we'll solve to find k.
Firstly we'll multiple both sides by (-7 + 1):
1(-7 + 1) = (-2 - k)/(-7 +1)(-7 + 1)
-7 = -2 - k
Now we'll add 2 to both sides:
-7 + 2 = -2 - k + 2
-5 = -k
Now to get k by itself we must divide by negative one on both sides:
-5/(-1) = -k/(-1)
5 = k
Your answer is 5 = k