"a carrot" isof "gives". Ming Hua gives a carrot.the direct object

"his rabbit" is theof "gives". Ming Hua givesindirect objecttohis rabbit.

Put them together and you get:

"Ming Hua gives his rabbit a carrot.

"to eat" is a to-infinitive which is added on to explain thepurposeof Ming Hua giving his rabbit a carrot:

"Ming Hua gives his rabbit a carrot to eat."

That's all basic, and the sentence is correct.

However, the teacher's sentence "Ming Hua gives his rabbit to eat a carrot." has only oneobject (indirect)and a to-clause. This is OK for verbs such as allow, permit, which do not take a direct object. eg.

"Ming Hua allows his rabbit to eat a carrot."

"Ming Hua permits his rabbit to eat a carrot."

But "give" requires two objects, a direct, and an indirect one.