Animaluses anAnimalBabyfield rather than a Boolean pregnancy field;- null represents the state where no unborn animal exists;
MakePregnant()creates aBabyonly when the field isnull;Babyvalues are assigned directly without a customInitialize(...)method;- the
Babyuses the parent's current animal type; Eat(double foodWeight)updates the adult;- the
Babyis updated only whenBaby != null; - all decisions remain simple one-way if statements.