Write a program that reads in a list of names allocates a


Implement a class person with the following fields:

The nam

A pointer to the persons best friend

A popularity counter that indicates how many people have this person as their best friend

  • Write a program that reads in a list of names, allocates a new Peron for every one of them, and places them in a vector. Next, request the name of each best friend for every Person objects. Find the object matching the friend's name, and call a set_best_friend member function to update the pointer and counter. Lastly, print out every Person objects. Labeling the name, best friend, and popularity counter for all.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program that reads in a list of names allocates a
Reference No:- TGS02242021

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)