If she knew that he went out for lunch and had already probably had it, she would ask "Did you have lunch?"
If she didn't know that he went out for lunch, and she was going out for lunch herself, and she might have wanted to have lunch with him if he hadn't already had lunch, she would ask "Have you had lunch?"
For the second question I would say "I just did my homework".
CJ