Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Help! C++ problem Problem A: Family tree (20 points) For this part, you are building a family tree starting at you (the base) and
Please Help! C++ problem
Problem A: Family tree (20 points) For this part, you are building a family tree starting at you (the "base") and going to past generations. You should start yourself out without a predefined name (just say "Unknown" if no name has been given yet). From here you should repeatedly give the user the following options until they choose to quit: . 'g'- give a name to the current person in the family tree. (You may assume names will be single words.) If they already have a name, it should replace the old one. . 'm'- change the current person to the mother currently displayed 'd'change the current person to the father currently displayed "b'-go back to "you", the starting person of the tree (or the "base"). qquit the program (without crashing or leaking memory) . Your code must contain the following: 1. A"person" class with: o o o o A constructor A destructor Contain Contain A string to hold the person's name s a person pointer to the mother s a person pointer to the father 2. A"person" pointer to keep track of the current pointer I strongly recommend you initialize your pointers to NULL, and use this to check and see if the pointer actually contain content. You should make the parents (both mother and father) of the current person when 'g, is selected to give a name. However, choosing 'g, should not erase your current parents if they already exist. If a pointer does not actually point to a person, show their name as "???" If you choose 'm' or 'd' to change to your mother or father, you should only change if the mother or father actually exists. If the pointer is not pointing to an object, you should stay at the current personStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started