A mother can make good cakes and pies. If she bakes 2 chocolate cakes and 1 apple pie, and then cuts them into 8 pieces each how many pieces would a family of 4 get altogether

what does it matter how many are in the family?

(2+1)*8 = 24

Now, if you wanted to know how many pieces each member of the family gets, it should be clear what comes next.