This program is a Family Tree Management System implemented in C++. It allows users to create and manage a family tree by adding family members and performing various operations on the tree.
To compile and run the program, you need a C++ compiler installed on your system. Follow the steps below to run the program:
-
Create a new C++ source file (e.g.,
main.cpp
) and copy the entire code into the file. -
Compile the source file using a C++ compiler. For example, you can use the following command with
g++
compiler:g++ -o family_tree main.cpp
This will generate an executable file named
family_tree
. -
Run the executable file to start the Family Tree Management System:
./family_tree
Output
![image](https://private-user-images.githubusercontent.com/76107601/247594999-f074fbf4-41c4-4777-913b-562662165cfe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1NTcxMjIsIm5iZiI6MTcyMDU1NjgyMiwicGF0aCI6Ii83NjEwNzYwMS8yNDc1OTQ5OTktZjA3NGZiZjQtNDFjNC00Nzc3LTkxM2ItNTYyNjYyMTY1Y2ZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA5VDIwMjcwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE2ZDcxNmU3NjQ1ZTJkYjk0YmY5NmI4MmY3MTgwOTcyNDY3ZjQzMzgyN2Q3YWM5NTRhNTY0ZmI5NDY3YzcxZGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ph9NpP0IncuilA94SROU6-pzTowfJtktkVc6Pm08Zy0)
![image](https://private-user-images.githubusercontent.com/76107601/247595359-76219d09-f4b0-4352-87a1-ec1cdaaff189.png?jwt=eyJhbG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TI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA5VDIwMjcwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4ZGE3YmZjNzM3NGFkYmJlNjhhYmFiNTU1YWFlOTEwNjA2NjA5OWU5MDUzYWY4NjI2YTg5YTAyMzM3NDM2MzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pIt_leoXj9Z97_fBWsG4grxNK6BSPDn69jp4wcdgajM)
The Family Tree Management System provides the following features:
- Add new members to the family tree: You can add new members to the family tree by providing their name, age, and gender.
- Show information of a particular person: You can display the information (name, age, and gender) of a specific person in the family tree.
- Delete the whole family tree: You can delete the entire family tree.
- Print the names of all people in the same generation: You can specify a generation number and print the names of all people in that generation.
- Find the least common successor: Given two names, you can find the least common successor (ancestor) in the family tree.
- Print the whole family tree: You can print the entire family tree in a 2D format using reverse inorder traversal.
- Find the parents of a particular person: You can find and display the names of the parents (mother and father) of a specific person.
- Find the spouse of a particular person: Given a person's name, you can find and display the name of their spouse.
- Find the child of a particular person: Given a person's name, you can find and display the name of their child.
- Exit the program: You can exit the Family Tree Management System.
Once you run the program, you will be presented with a menu of options. Enter the corresponding option number to perform the desired operation.
Note: The program assumes that each person in the family tree has a unique name.