Question: Social Media App Objectives Apply ArrayList and its methods to solve a problem such as a social media application Problem Create a social media app
Social Media App Objectives Apply ArrayList and its methods to solve a problem such as a social media application Problem Create a social media app to connect people. Your social media app allows you to create a list of the people you can follow. Also, you can follow your followers if you want to The functionality for this app is somewhat similar to the Instagram app. Here is the list I have created. Feel free to be creative by adding more functionalities. Add a follower Unfollow someone Follow someone Search the list of followers Update followers List all the followers Display the number of the followers Display the number of the people following Classes You are required to implement the following classes in the given order User class SociaMedia class Driver class Implement the classes in the given order, compile as you go User class Here is the UML diagram for the User class. User class must implement the comparable interface. The methods in this class are pretty straight forward. The order of implementing the methods is not important. Add an attribute of your choice to the user class. Make sure to add that attribute to the constructor of the user class. User String first String last String username boolean followBack add an attribute of your choice pointsUserString first, String last, String username, Boolean followBackgetFirst : String User getLast: String getFollow: Boolean setFirstString newFirst: void setLastString newLast : void toString : String follow: void unfollow: void equalsUser other: Boolean compareToUser other : int compare two username add the getter and the setter method for the attribute you just added Descriptions of the methods in the User class public User String first, String last, String username, boolean followBack: this constructor initializes the instance variables getFirst: returns the first name getLast : returns the last name getFollow: returns the followBack variable public void setFirstString first: allows to modify the first name public void setLastString last: allows to modify the last name public void unfollow: sets the followBack variable to false public void follow: sets followBack variable to true public boolean equalsUser other : compares the username to see if two users are the same return this.username.equalsIgnoreCaseotherusername public String toString: creates a String representing the User object in the following format, this is a sample output User name: TrevorS Name: Trevor Last name: Schlulz You are not following this person public int compareToObject o: compares the two users based on their username. You need to use compareTo method from the string class in this method. If two users have the same username, then they are the same people. This method gets Object o so dont forget to type case it to the User object. Refer to the video lectures SocialMedia class SocialMedia ArrayList app SocialMedia followBackString first, String last : void follow Boolean followBackString name, String last, String username : Boolean deleteString first, String last: boolean findString first, String last : boolean getList: ArrayList followerNum: int followingNum: int toString : String SocialMedia class methods Public SocialMedia : This constructor instantiates the ArrayList called app followBackString first, String last: this method goes through the arraylits app and finds the person with the given first and last name, once the person is found, call the method follow from the User class. Here is the code that you can use: String s first last; forint i ; i app.size; i String s app.getigetFirst app.getigetLast; ifsequalsIgnoreCases app.getifollow; Public boolean followString name, String last, String username, Boolean followback: This method gets the information for a User, creates a User object and adds it to the proper location in the list to keep the state of the list sorted. Dont add it to the end of the list. Make sure to also check whether or not the User is already in the list using the find method. Refer to the sample program posted on Canvas PlayList This method should return a boolean. Returning true means the follower was added, returning false means the follower is already in the list Public boolean deleteString first, String last : Use sequential search to find the follower in the list and delete it The first name and the last name of the follower should be passed to this method. This method should return true if the follower is found and deleted, returning false otherwise Public boolean findString first, String last: Thisn last name and returns true if the person was found. Search the list based on
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
