document.write( "Question 106348: Cassy had a bag of candy and was heading to the playground when she was intercepted by her arch nemesis, Rachelle. Rachelle thought Cassy had made fun of her the pervious day, so Rachelle tried to grab the bag of candy away from Cassy. In the ensuing battle, half the candy plus two pieces fell on the ground. Cassy maintained control of the bag and ran to the office to tattle on Rachelle. On the way to the office Cassy ran into Julio, whom she had a crush on. She gave Julio some of the candy in her bag, which just happened to be equal to one-fourth of what was left, plus five pieces. Just before Cassy got to theoffice her best friend Madison caught up with her. Cassy gave Madison half of the candy she had left. When Cassy got to the office and told the story to the principal, he asked to see the bag of candy. He told Cassy he would talk to Rachelle, but that it was against school policy to have candy on the campus. He then ate the remaining two pieces of candy. How many pieces of candy were originally in the bag? \n" ); document.write( "
Algebra.Com's Answer #77370 by solver91311(24713)\"\" \"About 
You can put this solution on YOUR website!
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,\r
\n" ); document.write( "\n" ); document.write( "After her encounter with Rachelle, Cassie had \"%28x%2F2+-+2%29\" pieces left in the bag.\r
\n" ); document.write( "\n" ); document.write( "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.\r
\n" ); document.write( "\n" ); document.write( "After her encounter with Julio, Cassie had \"%28%283%28x%2F2-2%29%29%2F4%29-5\" pieces left in her bag.\r
\n" ); document.write( "\n" ); document.write( "She gave half of what remained to Madison, so she retained half. Therefore, after her encounter with Madison, she had \"%28%28%283%28x%2F2-2%29%29%2F4%29-5%29%2F2\" pieces left.\r
\n" ); document.write( "\n" ); document.write( "But the principal ate the remaining 2 pieces. So we now know that \"%28%28%28%283%28x%2F2-2%29%29%2F4%29-5%29%2F2%29+=+2\" \r
\n" ); document.write( "\n" ); document.write( "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.\r
\n" ); document.write( "\n" ); document.write( "\"%28%28%28%283%28x%2F2-2%29%29%2F4%29-5%29%2F2%29+=+2\"
\n" ); document.write( "\"%28%28%283%28x%2F2-2%29%29%2F4%29-5%29+=+4\"
\n" ); document.write( "\"%283%28x%2F2-2%29%29%2F4+=+9\"
\n" ); document.write( "\"%283%28x%2F2-2%29%29+=+36\"
\n" ); document.write( "\"%28x%2F2-2%29+=+12\"
\n" ); document.write( "\"x%2F2+=+14\"
\n" ); document.write( "\"x=28\" Hence Cassie started with 28 pieces of candy.\r
\n" ); document.write( "\n" ); document.write( "Let's check the answer:\r
\n" ); document.write( "\n" ); document.write( "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.\r
\n" ); document.write( "\n" ); document.write( "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)\r
\n" ); document.write( "\n" ); document.write( "Cassie/Madison: Madison got half of 4, or 2, leaving 2 pieces in the bag. \r
\n" ); document.write( "\n" ); document.write( "And 2 pieces is what was left for the principal to eat.\r
\n" ); document.write( "\n" ); document.write( "(Extra credit if you forgive the principal for not letting Cassie have at least ONE piece of candy.)
\n" ); document.write( "
\n" );