Question 320204
Let 'x' be the number of quarters. 
Then the balance he got in quarters = 0.25x
Then the number of fifty cent coins = 30 - x. (since he was given a total of 30 coins).
The balance in fifty cents = 0.5(30 - x) = 0.5X30 - 0.5x = 15 - 0.5x
The balance he got = 20 - 10.5 = $ 9.5 
i.e. 0.25x + (15 - 0.5x) = $ 9.5 [balance in quarters and fifty cents together]

0.25x - 0.5x + 15 = 9.5
-0.25x = 9.5 - 15
-0.25x = -5.5
i.e. 0.25x = 5.5
         x = 5.5/0.25 = 22

So there are 22 quarters and (30 -22) = 8 fifty cent coins.