Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you need to write a basic social network system in C++with the following objectives: 1) Create new users and store them into
In this assignment, you need to write a basic social network system in C++with the following objectives: 1) Create new users and store them into a file. This must include their information as well. 2) Let the user log into the system and see what friends they have. Instructions Create a header file for a class Person that includes the following private members: name, age, place of birth, password, and friends lin the plural sensel. You must think of data types to those variables that take the LEAST amount of space in memory. Now create the implementation of the class. The major requirement is that the implementation must be in a separate .cpp file. Now create the main file. All users and their information must be stored in a txt file. You will ask the users the following option Please select a number for the option of: 1-Login2-Register3-Exit Option: If the user chooses option 1, you need to check the name and password of the user and only when you found a matching entry in the .txt file you should consider the user authenticated. After that you must create an object of type Person with all the information from the user contained in that file. You then must print all the private members of that class lexcept password!l using the operator. For the list of friends, you must print all the information of friends that you have in the .txt if the user's friends are registered to your system. For example, an output after the user authenticate could be Welcome Susie Marley! Your age is 45 You were born in the UK. You have 3 friends and they are - Samuel Jackson (55) born in the US. - Leslie Winkle (33) born in Australia. - Cristiano Ronaldo NOT REGISTERED. Note that the last user is not found in the .txt file, and the user must know about it. Also note that the program must take the least amount of space in memory! For the option 2 you are required to ask the user for their details and then create a new entry to the .txt file. You must ask also for how many friends the user have and who are these friends. You then must create an object of the type Person and display back to the user the information he has just entered, BUT using the same output as defined for option 1. That includes the list of friends and their information if they are found in the file. For the option 3, exit the program cleanly. Challenge All variables in the main should be dynamically allocated. The main requirement is that you don't get any segmentation fault during the execution of the program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started