Create a class Person with the following fields:
name
a pointer to the person's best friend (a Person*)
a popularity counter that indicates how many other people have this person as their best friend
Write down a program which asks user for names (Prompt user with something like "Enter a name, or q when finished"), assigns new Person (in heap memory) for each of them, and stores resulting pointer in vector . Next, ask for name of best friend for each of Person objects. (Use loop similar to the one which takes original input, this time with prompt like "Enter name of so-and-so's best friend") Locate object matching friend's name and call member function(s) to update pointer and popularity counter fields. At last, print all Person objects, listing the name, best friend, and popularity counter for each.
User input is to be taken one piece at time, but names are permitted to have spaces (like Bob Smith). You may suppose that user will only input "best friends" which are from the list of people which were entered.