Let x be the number of nickels and y be the number of quarters.
Then, x + y = 42 --- (1)
It is given that total value = 4.90.
Therefore, 0.05x + 0.25y = 4.9 --- (2)
Multiply (1) by 0.25
0.25x + 0.25y = 10.5 --- (3)
Now, subtract (2) from (3), we get,
0.2x = 5.6
Divide both sides by 0.2.
x = 28
x + y = 42
y = 42 - x
= 42 - 28
= 14
Hence, Mary has 28 nickels and 14 quarters in total.