Let N be the cost of the Notebook,
Let P be the cost of the Pencil.
Let M be the Money that he had.
The Notebook cost 4/5 of his Money less $7:
N = 4/5 of M - 7
N = 4/5 * M - 7
The Pencil cost 3/7 of the remaining of his Money, plus $4.
The remaining of his Money is: 1/5 of M.
So, the Pencil cost:
P = 3/7 of 1/5 of M + 4
P = 3/7 * 1/5 * M + 4
After buying the Notebook and the Pencil, he was still left with $12, so:
N + P = M - 12
Replacing N and P in the last equation:
(4/5 * M - 7) + (3/7 * 1/5 * M + 4) = M -12
4/5 * M - 7 + 3/7 * 1/5 * M + 4 = M - 12
(4/5)M - 7 + (3/35)M + 4 = M - 12
(4/5)M + (3/35)M - M = -12 + 7 - 4
(4/5 + 3/35) M - M = -9
(31/35)M - M = -9
(-4/35)M = -9
M = (-9) * (-35/4)
M = 78.75
Replacing for N:
N = 4/5 of M - 7
N = (4/5) * (78.75) - 7
N = 63 - 7
N = 56
Replacing for P:
P = 3/7 of 1/5 of M + 4
P = (3/7) * (1/5) * (78.75) + 4
P = (3/35) * ( 78.75) + 4
P = 6.75 + 4
P = 10.75
Checking your work:
N + P = M - 12
56 + 10.75 = 78.75 - 12
66.75 = 66.75
So, the Notebook cost $56 and the Pencil cost $10.75