Adam has some money. He wants to buy some balls. If he buys 5 balls, he will have $15 left. If he buys 8 balls, he will need $12 more. What is the cost of 1 ball?

If he has $x, then if a ball costs $b

x = 5b+15
x = 8b-12
so if
5b+15 = 8b-12
b = 9
check:
he has 45+15 = $60
5 balls cost $45, leaving $15
8 balls cost $72, so he's $12 short