You are developing a social media platform where users can create and manage their profiles. Write a
Question:
You are developing a social media platform where users can create and manage their profiles. Write a class named Profile that has private instance variables for user ID, username, number of posts, email address, followers, likes, comments, password, and profile picture. The class should have getter and setter methods for each instance variable, a constructor that takes user ID, username, email address, and password as parameters, and initializes the profile picture to the default image. The class should also have a destructor that prints a message when the object is destroyed. The Profile class should have the following methods:
1. A const member function named validateEmail that checks if the email address entered by the user is valid or not. You can validate by checking if the email address has the correct format, including an "@" symbol and a valid domain name.
2. A const member function named getPasswordStrength that returns the strength of the password entered by the user. You can define password strength based on various criteria, such as length, complexity, and character types used. For example, a character that has 12 N = 1,2,3,4 M = 5,6,7,8 4,3,2,1 8,7,6,5 1,2,3,4,5,6,7,8 4,3,2,1,8, 7,6,5 characters, special characters, lower- and upper-case characters, numbers, etc. Medium- strength passwords would be weaker, while weak being the weakest.
3. A const member function named getProfileCompletionPercentage that calculates the percentage of completed fields in the profile. You can define the completion criteria based on the required and optional fields in the profile. Having a strong password, a profile picture, and 100+ followers, are a few fields that can be used to determine the Completion Percentage.
4. A const member function named getUserActivity that returns the user's activity statistics, such as the number of posts, likes, comments, and followers.
5. A const member function that validates if the private variable “Profile Picture” is an existing file path.
6. A static function that returns the number of totals like a user has done.
7. A static function that returns the total number of posts of a user.
8. A dynamic member function that allows users to update profile information. They can choose what they want to update through this function.
Analytics Data Science And Artificial Intelligence Systems For Decision Support
ISBN: 9781292341552
11th Global Edition
Authors: Ramesh Sharda, Dursun Delen, Efraim Turban