Thursday, April 16, 2020

OPERATIONS ON FAMILY TREE

Now,when we complete the adding of members in Family tree,We require some operations such as:

1)Checking whether the person present in Family tree or not.


2)Finding the relationships between two members.


3)Display of Family tree


4)Destroying a Family tree 


5)Connecting Two Family Trees


6)Updating a Family Tree

etc.


We will implement a user driven Switch case,and according to the input given by user we will call that method.



 cout<<"\n\n\n\tFamily tree no = "<<n<<"\n\n\t
1. Add new person\n\t
2. Find relationship b/w two persons\n\t
3. Search\n\t
4. Destroy\n\t
5. Display\n\t
6. Change family tree\n\t
7. Connect two family trees\n\t
8. Exit\n\n\tEnter your choice = ";
        cin>>opt;
        cout<<endl;

        switch(opt)
        {

        default:
                cout<<"Invalid input";
                break;

        case 1:
                T[n].addNew();
                break;

        case 2:
                T[n].find();
                break;

        case 3:
                cout<<"Enter name of person to search: ";
                cin>>name;
                T[n].show(T[n].search(name));
                break;

        case 4:
                T[n].destroy(T[n].start);
                cout<<"Tree "<<n<<" has been destroyed sucessfully";
                break;

        case 5:
                T[n].display(T[n].start);
                break;

        case 6:
                cout<<"Enter family tree number: ";
                cin>>n;
                break;

        case 7:
               cout<<"Merge __ to __ \n";
               cin>>n2>>n1;
               connect(&T[n1],&T[n2]);
               break;

        case 8:
            return 0;

        }
        cout<<"\n\nPress any key to continue.....";
        cin>>c;
    }


This is just a overview of How the user will interact to call the methods.
In next Post We will provide you the total code for implementing each operation.

20 comments:

  1. It is very good written and coding part is also easy to understand.Good work:)

    ReplyDelete
  2. Very helpful! Especially the coding part.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Replies
    1. thank youπŸ™Œ we will try to write this types of code in our next blog.

      Delete
  5. Great work team .....πŸ™ŒπŸ™ŒπŸ™ŒπŸ™ŒCoding part is easy to understand πŸ’―πŸ’―πŸ’―πŸ’―

    ReplyDelete

DOCUMENTATION

Course project Title:      Implementation of Family tree Using Generalized Link List Description:    In this project we have create...