Let's start by finding the total number of parts in the ratio 8:7:5:9:
8 + 7 + 5 + 9 = 29
This means that the whole cake is made up of 29 equal parts.
Next, we need to find the mass of one part of the smaller piece that was divided into two parts. We can do this by adding the ratio parts together:
5 + 9 = 14
This means that the smaller piece was divided into two parts, each of which is 240g / 14 = 17.14g.
The smaller piece itself is made up of 8 + 7 = 15 ratio parts, so its total mass is:
15 x 17.14g = 257.1g
Finally, we can find the mass of the whole cake by using the ratio:
8 + 7 = 15 parts for the larger piece
15 + 5 + 9 = 29 parts for the whole cake
We know that the mass of one part of the smaller piece is 17.14g, so we can set up the following equation to find the mass of the whole cake:
15x + 15x(17.14g/240g) = 29x
Solving for x, we get:
x = 720g
Therefore, the mass of the whole cake is 29x = 20,880g (or 20.88kg).