Explanation:
Ok so Jessica bought M pens, which cost $6.70 each.
She also bought 4 fewer pencils than pens, or (M-4) pencils, at $3.50 each.
So in total, she spent:
6.7M + 3.5(M-4)
= 6.7M + 3.5M - 14
= 10.2M -14
So she spent $(10M - 14) on pens and pencils.
Hope this helped :)