Now,when we complete the adding of members in Family tree,We require some operations such as:
etc.
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.
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.
It is very good written and coding part is also easy to understand.Good work:)
ReplyDeleteThank you friend π
DeleteVery helpful! Especially the coding part.
ReplyDeleteys thank you
DeleteNicely coded!
ReplyDeleteGood work!
ReplyDeletedhanyavad
DeleteGreat work
ReplyDeleteGreat work!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank you for code..!
ReplyDeletethank youπ we will try to write this types of code in our next blog.
DeleteInformative
ReplyDeletethanks for apprecition
DeleteGreat work team .....ππππCoding part is easy to understand π―π―π―π―
ReplyDeletethanks a lot
DeleteNice
ReplyDeleteNice. .
ReplyDeleteNice
ReplyDeleteNice overview
ReplyDelete