Question 106348
Let's say that Cassie had x pieces of candy to start.  According to the problem, when she dropped the bag, half of the candy plus 2 pieces went on the ground which means that she still had half of the candy minus 2 pieces in the bag. So,

After her encounter with Rachelle, Cassie had {{{(x/2 - 2)}}} pieces left in the bag.

She gave one-fourth of what she had plus 5 pieces of candy to Julio, which means that she had three-fourths minus 5 pieces left in her bag.

After her encounter with Julio, Cassie had {{{((3(x/2-2))/4)-5}}} pieces left in her bag.

She gave half of what remained to Madison, so she retained half.  Therefore, after her encounter with Madison, she had {{{(((3(x/2-2))/4)-5)/2}}} pieces left.

But the principal ate the remaining 2 pieces.  So we now know that {{{((((3(x/2-2))/4)-5)/2) = 2}}} 

Now all we have to do is solve for x, and we will know how many pieces of candy Cassie had in the bag at the start.

{{{((((3(x/2-2))/4)-5)/2) = 2}}}
{{{(((3(x/2-2))/4)-5) = 4}}}
{{{(3(x/2-2))/4 = 9}}}
{{{(3(x/2-2)) = 36}}}
{{{(x/2-2) = 12}}}
{{{x/2 = 14}}}
{{{x=28}}}  Hence Cassie started with 28 pieces of candy.

Let's check the answer:

Cassie/Rachel:  Half plus 2 on the ground, half of 28 is 14 plus 2 is 16, 28 minus 16 leaves 12 pieces in Cassie's bag.

Cassie/Julio:  She gave one fourth plus 5 to Julio.  One-fourth of 12 is 3, plus 5 is 8.  12 minus 8 leaves 4.  (Apparently she REALLY liked Julio)

Cassie/Madison:  Madison got half of 4, or 2, leaving 2 pieces in the bag. 

And 2 pieces is what was left for the principal to eat.

(Extra credit if you forgive the principal for not letting Cassie have at least ONE piece of candy.)