Wow! This problem is kind of tricky. If you're ready to put your thinking cap on, brace yourself and good luck! Otherwise, you can skip it for now and return any time later
Annie has a family: mother Lucy, father James, sister Emily, and brother Luke. She creates a family tree, which you see below.
Now she wants to make this tree interactive. First, she wants the program to be able to determine the relationship between herself and a random family member. How many if expressions will Annie need to use to find out the relationship between herself and her random family member? For this, the program can use information about the person's parents (compare two people's parents) and gender (male or female).