A compound predicate contains two verbs which are connected by a conjunction. Having that it mind, the correct answer as to which sentence has a compound predicate with a direct object is the last option - Anne baked a cake and ate it. As you can see, there are two predicates here - baked and ate, and they are joined by the conjunction and. There is also a direct object here, the words cake and it.