It's not in the imperative. Not to ruin the funny, but just to be clear, it's a sentence fragment
On a more serious note, it might just be a phrase used in the idea of, you should have a kid...like a command.
What should I do now grandma...I'm 30 years old...have money a nice wife etc but I feel unfulfilled.
Avoir un enfant. (although avoir would probably be used in the imperative actually).
Nonetheless, context isn't alway the point in Duolingo. You can still learn the english phrase, 'to have joy'. 'to have a dog'. Then combine it later with what you know.
- J'aimerais avoir un enfant.
Gather round! Roll up! Roll up! Assorted children right here on me barrow! Every one a winner! Not five pounds. Not even two pounds But , and I'm robbing meself here: ONE POUND A CHILD! Now how's yer father, eh! Hand 'em out Gary!
I swear the voice is trying to speak as fast as possible sometimes, she could have a job at the end of politicians tv commercials!
Walking along a busy market somewhere in Asia and you approach a rather noisy stall out of curiosity which turns out to have babies on display and before you know the seller jumps in your face, forces one of the babies in your hands and goes: "Have a child!".