Money from Birthday, minus candy, minus shirt, minus sweater = money left over.
Let M be the amount of money he got on his birthday.
M - 5 - 13 - (M - 18)/2 = 16
M - 18 - (M - 18)/2 = 16
Multiply both sides by 2
2M - 36 - (M - 18) = 32
2M - 36 - M + 18 = 32
M - 18 = 32
M = 32 + 18 = 50
Joe got $50 for his birthday.
Check:
Money - candy - shirt
50 - 5 - 13 = 32
After Joe bought candy and a shirt, he had $32 left. Half of that was used to buy a sweater, so the sweater cost 32/2 = 16 dollars.
Money - candy - shirt - sweater = money left over
50 - 5 - 13 - 16 = 16
Hope this helps!