Let C be the number of pencils and S the number of pens that Anthony bought.
Since a total of 12 pens and pencils were bought, then:
![C+S=12](https://img.qammunity.org/2023/formulas/mathematics/college/9h91pryjy8k7s7zs0ruynabtuk1z8r2p80.png)
Since Anthony spent $2.80 and each pen costs $0.35 while each pencil costs $0.15, then:
![0.35S+0.15C=2.80](https://img.qammunity.org/2023/formulas/mathematics/college/wulwy10jk1cy3osykld5irkx3fzvtldwtu.png)
Since we want to know S (the number of pens that Anthony bought), isolate C from the first equation:
![C=12-S](https://img.qammunity.org/2023/formulas/mathematics/college/cbhmw7oy4fuk7ccgll7iabi51609em7r8r.png)
Substitute C=12-S into the second equation:
![0.35S+0.15(12-S)=2.80](https://img.qammunity.org/2023/formulas/mathematics/college/69wvdrj0dbe108b77r8weh9kfz1rcmfrkt.png)
Use the distributive property to rewrite 0.15(12-S) as 0.15*12-0.15S:
![0.35S+0.15\cdot12-0.15S=2.80](https://img.qammunity.org/2023/formulas/mathematics/college/3uq2jc5ckzguhz808g0t1flu8mqx7n2hxu.png)
Sum alike terms on the left hand side of the equation:
![0.20S+0.15\cdot12=2.80](https://img.qammunity.org/2023/formulas/mathematics/college/c0hwtq2c4s2ysyt9bb9agi8iuhmfpjl5fu.png)
Multiply 0.15*12:
![0.20S+1.80=2.80](https://img.qammunity.org/2023/formulas/mathematics/college/7bi0b6htss9yd1a36z10es0ktymbxhq2xc.png)
Substract 1.80 from both sides of the equation:
![0.20S=2.80-1.80](https://img.qammunity.org/2023/formulas/mathematics/college/ma8iz5lyqgt3h2ikj3csmtutmek9o2dwws.png)
Simplify the sum on the right hand side of the equation:
![0.20S=1.00](https://img.qammunity.org/2023/formulas/mathematics/college/kj2b9n0uv9s4igohvwn8odbhr66vq0cgnc.png)
Divide both sides by 0.20:
![S=(1.00)/(0.20)](https://img.qammunity.org/2023/formulas/mathematics/college/6cevolvsq1t8frzi790r0cjkpjnwdlr5yj.png)
Simplify the fraction:
![S=5](https://img.qammunity.org/2023/formulas/mathematics/college/remdzkbehq3rv14mhtq1kdet6mo4fz5p1p.png)
Therefore, Anthony bought 5 pens.