GoalsTo learn about pointers, dynamic memory allocation and data structures managed by pointers. Your AssignmentClass Person is defined in these files person.h and person.cpp. Use separate compilation methods we have learned to use the Person class in your hw9.cpp file. Your hw9.cpp will utilize the Person class. Your hw9.cpp will contain the int main() which you will write. Write a program that gets names as input from the user (Read from the console using cin. You may tell the user to enter a name or q to quit entering names.) , allocates a new Person for each of them and stores the pointer to each of them in a vector Here is a sample run of the program: Other instructionsThe main difficulty in this program is that you are dealing with pointers to Person objects. You are not directly dealing with Person objects. Keep this in mind as you write your code. Before you access any pointer, make sure it is not NULL. Write if statements as necessary to test for this. A persons popularity goes up if they are someones best friend. If you have a best friend that does not increase YOUR popularity. You need to write all necessary member functions for the class. What to Turn in.Upload to ccle the source file hw9.cpp
FAQQ: Are all names unique? A: Yes. There are no repeated names. Q: Will everyone have a best friend? A: Yes. Everyone has a best friend. Q: How should we handle user errors? A: You are the user. You will not make mistakes. GradingThis assignment is worth 5 extra credit points. Turn in something that works and you get 5 pts. |