Question: please i need in terminal ASAP , CSE 202 Lab 4: Classes, Vectors, and Pointers 1. Perform the following exercises under lab4 sub directory 2.

please i need in terminal ASAP ,

please i need in terminal ASAP , CSE 202 Lab 4: Classes,Vectors, and Pointers 1. Perform the following exercises under lab4 sub directory2. Implement class Person with the following fields: the name a pointerto best friend (Person ) . a popularity counter that indicates howmany other people have this person as their best friend Write aprogram that reads in a list of names, allocates an object of

CSE 202 Lab 4: Classes, Vectors, and Pointers 1. Perform the following exercises under lab4 sub directory 2. Implement class Person with the following fields: the name a pointer to best friend (Person ) . a popularity counter that indicates how many other people have this person as their best friend Write a program that reads in a list of names, allocates an object of type Person for each name, and stores them in a vector of pointers: vector. The program then asks for name of the best friend for each person, locates the object matching the friend's name, and calls set_best_Eriend() member function to update the pointer and counter. Finally, the program should print out all Person objects. This includes listing the name, best friend, and popularity count for cach person The following three files implement most of the above functionality. Prior to running the program, make sure file names with a list of names already exists in your directory #1fndef PERSONE define PERSON H I/ your name Person.h /I date II description #include using namespace stdi class Person string name; Person best friend; int popularityi public: Person(): name(),best_friend (0), popularity (0)h Person (string n): name (n), best_friend (0), popularity (0) string get_name) string get best_friend; int get_popularity)i void set best friend (Peraon ) Wendif CSE 202 Lab 4: Classes, Vectors, and Pointers 1. Perform the following exercises under lab4 sub directory 2. Implement class Person with the following fields: the name a pointer to best friend (Person ) . a popularity counter that indicates how many other people have this person as their best friend Write a program that reads in a list of names, allocates an object of type Person for each name, and stores them in a vector of pointers: vector. The program then asks for name of the best friend for each person, locates the object matching the friend's name, and calls set_best_Eriend() member function to update the pointer and counter. Finally, the program should print out all Person objects. This includes listing the name, best friend, and popularity count for cach person The following three files implement most of the above functionality. Prior to running the program, make sure file names with a list of names already exists in your directory #1fndef PERSONE define PERSON H I/ your name Person.h /I date II description #include using namespace stdi class Person string name; Person best friend; int popularityi public: Person(): name(),best_friend (0), popularity (0)h Person (string n): name (n), best_friend (0), popularity (0) string get_name) string get best_friend; int get_popularity)i void set best friend (Peraon ) Wendif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!