Hi Ben,
I like to take these problems sentence by sentence or phrase by phrase and write the mathematical expression the sentence suggests.
1st sentence
Q = # quarters
D = # dimes
N = # nickels
2nd sentence
D = 2N
Q = 8D
From the if statement
.05N + .1D + .25Q = 29.70
Is is possible that there is a typo here and the total value is $29.75 rather than $29.70? I'm going to continue the problem based on $29.75
Let's restate the equations we derived from the 2nd sentence so that both are in terms of D
N = D/2
Q = 8D
Now let's substitute these expressions for N and Q in the equation .05N + .1D + .25Q = 29.75
.05(D/2) + .1D + .25(8D) = 29.75
.025D + .1D + 2D = 29.75
Multiply by 1000 to get rid of the decimal points
25D + 100D + 2000D = 29750
2125D = 29750
D = 14
But we need the number of quarters.
Q = 8D
Q = 8(14) = 112
There 112 quarters.
And just because,
There are 7 nickels
FYI, if you use $29.70, you don't get a whole number when solving for the number of dimes. This is what led me to think there was a typo.