You can 
put this solution on YOUR website! 
Think about it for a bit...  if you can figure out the cost of one pencil, the whole problem can be solved.   What given information tells you how much one pencil costs?   
Ans: 24 dollars buys 10 pencils  so ONE pencil costs  $24/10
From there, using the other given information, you should be able to solve.