% File "ftree.tu". % % % FamilyTree records all the births in a structured format for a family % of animals. A family of animals is defined as the set of animals who % all have the same ancestor, who has no ancestor himself. I.e., this % ancestor is the root of a tree of children. % %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ unit class FamilyTree import Animal in "animal.tu" export Init, AddMember, Prnt %========== INSTANCE VARIABLES ============================== %============================================================ %%%% YOUR CODE HERE % initialize the three instance variables %------------------------------------------------------------ proc Init (head_of_family : ^Animal) %%%% YOUR CODE HERE end Init %========== PUBLIC FUNCTIONS ================================ %============================================================ proc AddMember (parent1 : ^Animal, member : ^Animal, parent2 : ^Animal) %%%% YOUR CODE HERE end AddMember % print the tree to the file stream %------------------------------------------------------------ proc Prnt (stream : int) %%%% YOUR CODE HERE end Prnt end FamilyTree