\r\n" );
document.write( "Hakim spent 3/8 of his money on 3 cupcakes and 8 muffins. Then he spent 4/5 of the remaining money on 15 pieces of waffle. Each cupcake cost 2/3 as much as a muffin. Each piece of waffle cost $0.20 more than a cupcake. What was the cost of a muffin?\r\n" );
document.write( "\r\n" );
document.write( "Let amount spent, be D, cost of a muffin, M, and cost of a cupcake. C\r\n" );
document.write( "\r\n" );
document.write( "For the first purchase, we get:
\r\n" );
document.write( " 3D = 24C + 64M ---- Multiplying by LCD, 8 ---- eq (i)\r\n" );
document.write( "\r\n" );
document.write( "For the second purchase, we get:
\r\n" );
document.write( "
\r\n" );
document.write( "
\r\n" );
document.write( "
= 15W ---- eq (ii)\r\n" );
document.write( "\r\n" );
document.write( "Each cupcake cost
as much as a muffin, so: C =
---- eq (iii)\r\n" );
document.write( "\r\n" );
document.write( "Each piece of waffle cost $0.20 more than a cupcake, so: W =
---- eq (iv)\r\n" );
document.write( "\r\n" );
document.write( "
------ eq (ii)\r\n" );
document.write( "
---- Substituting
for W, in eq (ii) \r\n" );
document.write( "
\r\n" );
document.write( "D = 6 + 20M ---- Multiplying by LCD, 2 ---- eq (v)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " 3D = 24C + 64M ------ eq (i)\r\n" );
document.write( "
--- Substituting
for C, in eq (i) \r\n" );
document.write( "3D = 8(2M) + 64M\r\n" );
document.write( "3D = 16M + 64M\r\n" );
document.write( "3D = 80M ---- eq (vi)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " D = 6 + 20M ---- eq (v)\r\n" );
document.write( " 3D = 80M ---- eq (vi)\r\n" );
document.write( " 3D = 18 + 60M ---- Multiplying eq (v) by 3 ---- eq (vii)\r\n" );
document.write( " 0 = - 18 + 20M --- Subtracting eq (vii) from eq (vi)\r\n" );
document.write( "- 20M = - 18\r\n" );
document.write( "Cost of a muffin, or 
\n" );
document.write( "