I'm not too sure, I've not done mechanics for a good few months (if you have the answers in the back of your book you could check this answer)

p + 5 = 2

Therefore p = -3

-7 + q = -3

Therefore q = 4.

If you have till monday i recommend asking your teacher tomorrow (friday)