Question: Design and implement an application that maintains the data for a simple social network. Each person in the network should have a profile that contains
Design and implement an application that maintains the data for a simple social network. Each
person in the network should have a profile that contains the persons name, current status, and a
list of friends. Your application should allow a user to join the network, leave the network, create
a profile, modify the profile, and add friends.
Following are the specifications:
Design a class for representing a persons name eg Name with instance variables for firstname
and lastname, one or more constructors, and related getter and setter methods.
Design a class for representing a persons profile eg Profile with instance variables for
persons name eg private Name profileName; status a String and a list of friends profiles
eg private AList friends; You may use a list implementation of your choice eg an
arraybased list or a linked list. See Chapters and
Have one or more constructors and related getter and setter methods.
Have a method for adding a friend eg addFriend to the profile list. This method should
receive the new friends profile as an argument.
Have a method for removing a friend eg removeFriend from the profile list. This
method should receive the friends profile that has to be removed as an argument.
Have a display method that prints the profile name status, and friends
Design a class for managing the profiles on the social network eg ProfileManager Have an
instance variable that refers to a list of all profiles eg private AList allProfiles;
Have a constructor that initializes the profile list to an empty list.
Have a method for adding a profile to the profile list. The profile to be added should be
passed as an argument to this method.
Have a method for removing a profile from the profile list. The profile to be removed
should be passed as an argument to this method.
Have a method for creating a friendship between two profiles. This method should
receive two profiles as arguments. The first profile argument should be added as a
friend to the second profile and viceversa eg b
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
