Let x be the number of half dollar and y, the number of quarter dollar
Thus,

Half dollar is 50cent, quarter dollar is 25cents,
Thus,

Solving the two(2) equations simultaneously; we have:
From eq i)

Put eq iii) into ii), we have:

From eq iii)

Hence, there are 5 half dollars and 12 quarter dollars inside the cup