Question: Assignment 4: LinkedIn Recursion This assignment will be building on to the prior assignment and will utilize the same Eclipse project. Please refer to assignment
Assignment 4: LinkedIn Recursion
This assignment will be building on to the prior assignment and will utilize the same Eclipse project. Please refer to assignment 3 if you need assistance downloading the project template and understanding the existing architecture that you will contribute to.
You will be adding four new menu actions to your application; list connections, add connection, remove connection, and degree of separation.
Task 1 List Connection Action
Package: edu.institution.actions.asn4
Class: ListConnectionAction
This action will loop through the logged in users connections and display the user name of each LinkedIn user in the connections list. If the logged in user has no connections, display the message, You have no connections to the console. Return true to keep the user logged in.
| public class ListConnectionAction implements MenuAction { // implement the process method } |
The process method for the action should return true to keep the user signed in.
Task 2 Add Connection Action
Package: edu.institution.actions.asn4
Class: AddConnectionAction
This action will add a LinkedIn user to the logged in users connection list. The steps to take are: Prompt for the user name of the user to connect with.
If the user does NOT exist, display the message, There is no user with that user name and return true to keep the user signed in.
If the user does exist, add the user to the logged in users connection list and display the message, The connection was added successfully.
If the user is already in the logged in users connection list, then catch the LinkedInException that was thrown in the second assignment and display the message contained within the exception.
Return true to keep the user signed in.
| public class AddConnectionAction implements MenuAction { // implement the process method } |
The process method for the action should return true to keep the user signed in.
Task 3 Remove Connection
Package: edu.institution.actions.asn4
Class: RemoveConnectionAction
This action will remove a user from the logged in users connection list. The steps to take are:
(Use the supplied Scanner instance to prompt the user for information. Do not create your own instance of Scanner in any action)
Prompt for the user name of the connection to remove
If the user does NOT exist, display the message, There is no user with that user name and return true to keep the user signed in.
If the user does exist, remove the user from the logged in users connection list and display the message, The connection was removed successfully.
If the user was not connected to the logged in user, then catch the LinkedInException that was thrown in the second assignment and display the message contained within the exception.
| public class RemoveConnectionAction implements MenuAction { // implement the process method } |
The process method for the action should return true to keep the user signed in.
Task 4 Degree of Separation
Package: edu.institution.actions.asn4
Class: DegreeOfSeparationAction
Using recursion, this action will display the path and the number of connections between the logged in user and the entered user. For example, assume the logged in user is Gwen and that this hierarchy existed.
(Use the supplied Scanner instance to prompt the user for information. Do not create your own instance of Scanner in any action)
gwen is connected with doug
doug is connected with sam
sam is connected with nat
nat is connected with zane
If the entered user was Zane, then the output would be:
There is 3 degrees of separation between you and zane gwen -> doug -> sam -> nat -> zane.
The degree of separation doesnt include the initial user and the end user. The process method for the action should return true to keep the user signed in.
How You Are Graded
1. Your implementation properly lists the logged in users connections as specified in this assignment (1 point)
2. Your implementation allows the logged in user to add a new connection as specified in this assignment (2 point)
3. Your implementation allows the logged in user to remove a connection as specified in this assignment (2 point)
4. Your implementation properly displays the Degrees of Separation data as specified in this assignment (5 points)
Notes
1. You are not required to write JUnit tests for this assignment.
2. Your project is sent to a service which tests and attempts to grade your assignment. That automated grading process is much easier if you follow the instructions with regards to class names, method names, and output messages. I do evaluate your project after the automated grading occurs to help you understand any mistakes that was pointed out and possibly adjust any points that was deducted from your project.
3. Your project is sent to a service that checks for plagiarism. If the service flags your project for plagiarism, I evaluate it against the student it matched to. If I determine that your project was plagiarized, you will receive a score of zero on the assignment. Continued offenses could result in disciplinary actions taken by this institution.
4. If your program does not compile, you will receive a score of zero on the assignment 5. If your program compiles but does not run, you will receive a score of zero on the assignment.
6. If your Eclipse project is not exported and uploaded to the drop box correctly, you will receive a score of zero on the assignment.
7. If you do not submit code that solves the problem for this assignment, you will not receive any points for the programs compiling or the programs running.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
