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. by using the addFriend method of the
Profile class).
Have a method for ending a friendship between two profiles. This method should receive
two profiles as arguments. The first profile (argument) should be removed as a friend
from the second profile and viceversa (e.g. by using the removeFriend method of the
Profile class).
Have a display method that prints all the profiles (e.g. by using the display method of the
Profile)
Design a driver program (e.g. FacebookApp) that creates a profile manager, creates profiles,
adds profiles to the profile manager, creates friendships, ends friendships, and removes profiles.
Be sure to display the profiles and profile manager info after making any updates.
A sample output file is attached.

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

barking brake lights that flashes

Answered: 1 week ago