Answer: 18 pies, 22 cakes
Step-by-step explanation:
Let the number of pies sold be represented by p.
Let the number of cakes be represented by c.
The information in the question can then be represented in an equation as:
p + c = 40 ........ i
10p + 8c = 356 ....... ii
Multiply equation i by 10
Multiply equation ii by 1
10p + 10c = 400 ....... iii
10p + 8c = 356 ....... iv
Subtract iv from iii
2c = 44
c = 44/2
c = 22
22 cakes were sold
Since 40 items were sold, the number of pies sold will be:
= 40 - 22
= 18 pies