A piggy bank contains 36 coins that consists of dimes and quarters totaling $5.85. How many quarters are in the piggy bank? In your final answer, include all necessary calculations.

Let's use algebra to solve the problem.

Let d be the number of dimes in the piggy bank.
Let q be the number of quarters in the piggy bank.

We know that:

d + q = 36 (because there are 36 coins in total)
0.1d + 0.25q = 5.85 (because the value of all the coins is $5.85)

We want to solve for q. Let's rearrange the first equation to get:

d = 36 - q

Now we can substitute this into the second equation:

0.1(36-q) + 0.25q = 5.85

Expand and simplify:

3.6 - 0.1q + 0.25q = 5.85

0.15q = 2.25

q = 15

So there are 15 quarters in the piggy bank. To check, we can substitute q = 15 into either equation and solve for d:

d + 15 = 36

d = 21

Now we can check that the total value of all the coins is $5.85:

0.1(21) + 0.25(15) = 5.85

2.1 + 3.75 = 5.85

5.85 = 5.85

It checks out!