Hopefully you sketched a graph, though?

There's a formula for the equation, and what it does is set m = the derivative at x = 2 (i.e. m = 12 - k, as you say) and then it says (but you could tell this from a sketch - of ANY curve, in fact) that the y-intercept,

c = y(2) - 2m = 14 - 2k - 24 + 2k = -10.

So you have a c to plug into

5 = m*5 + c = (12 - k)*5 + c

and you can solve for k.