"I bought five pieces of fruit cake."
Is this the rich, heavy fruit cake that in the UK would be made with dried fruit such as currants, sultanas and raisins and served at Christmas? Or does it mean a cake that has fresh fruit on it - which would probably be called a fruit gateau in the UK (and more usually would be on pastry and called a fruit tart)? I don't mind translating it as 'fruit cake' but I would like to know what I would get if I asked for it in China!
了 has two correct options, depending on the sentence.
Firstly, the given translation contains 了 placed next to the verb, which identifies the action done past.
Secondly, if you place 了 on the right, this also expresses the same thing. The sentence then becomes 我买五块水果蛋糕了。However, the sentence can emphasize "change of state", which has more general meaning.