rahuljauhari3 / Family-Tree-Management-System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FAMILY-TREE-Cpp

Family Tree Management System

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.

Getting Started

To compile and run the program, you need a C++ compiler installed on your system. Follow the steps below to run the program:

  1. Create a new C++ source file (e.g., main.cpp) and copy the entire code into the file.

  2. 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.

  3. Run the executable file to start the Family Tree Management System:

    ./family_tree
    

Output

image image image

Features

The Family Tree Management System provides the following features:

  1. Add new members to the family tree: You can add new members to the family tree by providing their name, age, and gender.
  2. Show information of a particular person: You can display the information (name, age, and gender) of a specific person in the family tree.
  3. Delete the whole family tree: You can delete the entire family tree.
  4. 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.
  5. Find the least common successor: Given two names, you can find the least common successor (ancestor) in the family tree.
  6. Print the whole family tree: You can print the entire family tree in a 2D format using reverse inorder traversal.
  7. Find the parents of a particular person: You can find and display the names of the parents (mother and father) of a specific person.
  8. Find the spouse of a particular person: Given a person's name, you can find and display the name of their spouse.
  9. Find the child of a particular person: Given a person's name, you can find and display the name of their child.
  10. Exit the program: You can exit the Family Tree Management System.

Usage

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.

About


Languages

Language:C++ 100.0%