A corner store sells two kinds of baked goods: cakes and pies. A cake costs $5 and a pie costs $4. In one day, the store sold 10 baked goods for a total of $46.

a. Write a system of equations to represent this situation.

b. Show work, using substitution, to determine how many cakes were sold.