Question: IN C++ Write a Twitter class that sets the Twitter user first (whos to be followed) and lets the client add up to 5 followers.

IN C++

Write a Twitter class that sets the Twitter user first (whos to be followed) and lets the client add up to 5 followers. These users/followers could be in form of string or Profile*. At any time your main program should be able to remove any given user from the follower list, which will be stored in an array with a capacity of 5. You need to have a function which can print all followers at any time and calling this function after a removal is a requirement. You are free to design your program with your own will as long as you fulfill the followings:

1. Main program should use the Twitter class template, which you should write in a separate .h file. (10 points)

2. In the main program two types objects need to be created, i.e.,

a. Twitter (10 points)

b. Twitter (10 points) where Profile is a struct that contains three fiels (username, age, state)

3. A constructor which does initialization for the followed user and number of followers. (5 points)

4. AddFollower function (10 points)

5. RemoveFollower function (10 points) (Hint: you may need to check whether the given user and the array member are equal to each other. Profile struct may require an overloaded operator=)

6. PrintFollower function. (10 points) (This should be called after removal of a user) (Hint: cout<< works with string, but you should add the overloaded operator below in your code to be able to print a Profile object)

* struct Profile{ string username; int age; string state; };

Thank you! Please add comments explaining what he main code parts do.

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!