Answer:
There might be more to this problem that not included?
Based on the question written, J and Q would be anything that is mathematically supported.
I could a virtually endless combination, that's why I think we may be missing part of the question.
Here are some solutions:
J=11, Q = 6 11-5=6
J=12, Q= 7 12-5=7
J= 7, Q = 2 7-5=2
J = 162, Q = 157 162-5=157