Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 (e.g. 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 (e.g. Profile) with instance variables for
persons name (e.g. private Name profileName;), status (a String), and a list of friends profiles
(e.g. private AList friends;). You may use a list implementation of your choice (e.g. an
array-based list or a linked list. See Chapters 10,11, and 12).
Have one or more constructors and related getter and setter methods.
Have a method for adding a friend (e.g. addFriend) to the profile list. This method should
receive the new friends profile as an argument.
Have a method for removing a friend (e.g. 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 (e.g. ProfileManager). Have an
instance variable that refers to a list of all profiles (e.g. 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 (e.g. b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions