B. Le了 is used to ask or answer questions about whether one has done something. (Did you ...? or Have you ...?)
Nǐ chī fàn le ma? 你吃饭了吗? Haven you eaten yet?
Chī le. 吃了。 Yes, I have.
Kèrén lái le ma? 客人来了吗? Have the guests arrived yet?
Lái le. 来了。 Yes, they have.
The Interrogative and the Negative. (The question form may use méi yǒu没有 instead of ma at the end of the sentence. The negative uses méi yǒu没有 or méi没 before the verb, and le了 is dropped. If the speaker intends to do something, but has not done it yet, he/she uses 'hái méi还没 ... ne呢' meaning 'have not ... yet'.
Nǐ zuò zuòyè le méi yǒu? = Nǐ zuò zuòyè le ma? 你做作业了没有?= 你做作业了吗? Did you do (or: Have you done) your homework?
Méi zuò.(or:Hái méi [zuò] ne.) 做了。(还没 [做] 呢。) No, I did not. (I haven't [done it] yet.)