start a basic equation
n = nickel
d = dimes
n + d = 51
since nickels are five cents, it is .05
And since dimes are ten cents, it is .10
So the second equation is .05n + .10d = 4.15
If n + d = 51, than n = 51 - d
plug that into the second equation
.05(51-d) + .10d = 4.15
Solve the equation
d = 32
Plug that into n = 51 - d(32) to get 19
32 dimes and 19 nickels