Let x = # of nickels. Then the number of quarters is (20-x). The nickels contribute 5x to the total. The quarters contribute 25(20-x) to the total. The "value" equation is 5x + 25(20-x) = 340 (cents). Simplify and solve: 5x + 500 - 25x = 340 ---> -20x = 340 - 500 = -160 ---> x == 8. Answer. 8 nickels and 12 quarters.