Christopher's pennies and quarters total $15.74. If the pennies were replaced by quarters and the quarters were replaced by pennies, then he would have $6.62. How many of each coin does he have?

Let

p = # pennies
q = # quarters
Then we know that
p+25q = 1574
25p+q = 662
so,
25(1574-25q)+q = 662
q = 62
check:
24+62*25 = 1574
62+24*25 = 662