Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

Answer The code is as follow include include include class Profile private stdstring userID stdstring username int numPosts stdstring emailAddress int followers int likes int comments stdstring passwo... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Analytics Data Science And Artificial Intelligence Systems For Decision Support

Authors: Ramesh Sharda, Dursun Delen, Efraim Turban

11th Global Edition

1292341556, 9781292341552

More Books

Students also viewed these Programming questions

Question

Research the role of chatbots in helping patients with dementia.

Answered: 1 week ago