Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment will test your skills in creating and using linked lists and file processing. You should not use the Java built in linked list

This assignment will test your skills in creating and using linked lists and file processing. You should not use the Java built in linked list class. Instead, you must use the Node class and LinkedList class discussed in the lectures, and make necessary modifications to these classes. First download Node.java and LinkedList.java. Also download LinkedListDemo1.java and LinkedListDemo2.java from the assignment webpage. Study the programs before you begin the assignment. The specification for this assignment is long, but the assignment itself is not difficult once you start understanding the basic structure and the methods, and implementing the classes. FriendList is a new social media tool. It keeps track of all of its users and their friends. It can calculate the total users of the social medial tool, the user with the most friends, the user with the oldest friend, and can also find the common friends between two users. Users can also be added and removed from Friendlist. In order to join FriendList a user must be at least 13 years old and when a user is removed, not only is the user removed from FriendList but also from any users friend lists. Each user has a name, their current location (name of the city or town), and birth year. Users also have a list of friends (a linked list of a Users friends). If a user adds another user as a friend, then the other user will also add this user as a friend (that is, if A is a friend of B, then automatically B is a friend of A - similar to Facebook). You will need to implement two classes for this social media tool: FriendList, and User. The attributes and methods for each class are listed below (as well as a short explanation of some of the methods). You will implement all the lists in this program as linked lists. In addition, you will need to modify the Node and LinkedList classes so that data stored/retrieved is of User type. Make sure you do proper error testing as well, for example you should not add a user to FriendList if they already exist. And new members need to be at least 13 years old. You can add extra methods or attributes if you find it necessary.

*I am using JGrasp so please make sure it is compatible *Please comment throughout code *FULL QUESTION IN IMAGES BELOW

https://web.cs.dal.ca/~srini/cs1101/Node.java

https://web.cs.dal.ca/~srini/cs1101/LinkedList.java

https://web.cs.dal.ca/~srini/cs1101/LinkedListDemo1.java

https://web.cs.dal.ca/~srini/cs1101/LinkedListDemo2.javaimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

This assignment will test your skills in creating and using linked lists and file processing. You should not use the Java built in linked list class Instead, you must use the Node class and LinkedList class discussed in the lectures, and make necessary modifications to these classes. First download Node.java and LinkedList.java. Also download LinkedListDemoljava and LinkedListDemo2.java from the assignment webpage. Study the programs before you begin the assignment. The specification for this assignment is long, but the assignment itself is not difficult once you start understanding the basic structure and the methods, and implementing the classes. FriendList is a new social media tool. It keeps track of all of its users and their friends. It can calculate the total users of the social medial tool, the user with the most friends, the user with the oldest friend, and can also find the common friends between two users. Users can also be added and removed from Friendlist. In order to join FriendList a user must be at least 13 years old and when a user is removed, not only is the user removed from FriendList but also from any user's friend lists Each user has a name, their current location (name of the city or town), and birth year. Users also have a list of friends (a linked list of a User's friends). If a user adds another user as a friend, then the other user will also add this user as a friend (that is, if A is a friend of B, then automatically Bis a friend of A similar to Facebook) You will need to implement two classes for this social media tool: FriendList, and User. The attributes and methods for each class are listed below (as well as a short explanation of some of the methods). You will implement all the lists in this program as linked lists. In addition, you will need to modify the Node and LinkedList classes so that data stored/retrieved is of User type. Make sure you do proper error testing as well, for example you should not add a user to FriendList if they already exist. And new members need to be at least 13 years old. You can add extra methods or attributes if you find it nec FriendList This class has one attribute allUsers (a Linkedlist of Nodes that stores Users) It also can implement the following methods: FriendList(): /o args constructor that creates a new empty lis addUser (User u) void //adds a user after checking that they are at least 13 years old and do not already exist remove User (User u):void //remove user from FriendList and remove that user as a friend of any other users totalUsers ():int//returns the total number of users on FriendLis getUsers 0:LinkedList turns the list of all us mostFriends User //returns the user who has the most friends. If two or more users have the 'most friends' (i.e., a tie for most friends, return the first User with that number (similar to how ArrayLists handle this case) oldest Friend0:User eturns the user(s) with the oldest friend. If two or more users have 'the oldest' friend (i.e., same birthday eturn the first User (similar to how ArrayLists handle this case) common Friends (User, User): find common friends between us and returns new list User Attributes String name String location //this is where they currently live (city or town) int birth Year LinkedList friends //this is a LinkedList that holds Nodes of Users who are their friends It implements the following methods: User (String, String, int): //set name, location and birthYear, initialize the LinkedList getName String getLocation String getBirthYear(): int sEqual (User) boolean getFriends LinkedList

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

More Books

Students also viewed these Databases questions

Question

What are some of Samsungs greatest competitive strengths?

Answered: 1 week ago

Question

Explain basic guidelines for effective multicultural communication.

Answered: 1 week ago

Question

Identify communication barriers and describe ways to remove them.

Answered: 1 week ago

Question

Explain the communication process.

Answered: 1 week ago