Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 6: Ordering Elements in a List Please show code. Please code in Java. This assignment will be building on to the prior assignment and

Assignment 6: Ordering Elements in a List

Please show code.

Please code in Java.

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 three new menu actions to your application; list users alphabetically, list users by number of connections, and list users by type.

Task 1 List Users Alphabetically Action

Package: edu.institution.actions.asn6

Class: ListUserAlphabeticallyAction

In the second assignment you made the LinkedInUser class implement Comparable, ensuring that the natural order of the LinkedInUser is by username (ignoring capitalization). Assuming you did the second assignment correctly, this menu option should already be done. However, if you failed to list the users alphabetically (ignoring capitalization) in the second assignment, then you will need to do so in this assignment.

public class ListUserAlphabeticallyAction implements MenuAction {

// implement the process method

}

The process method for the action should return true to keep the user signed in.

Task 2 List User by Type Action

Package: edu.institution.actions.asn6

Class: ListUserByTypeAction

Add a new method which displays the LinkedIn users, ordered first by their type and second alphabetically by their user name.

For example:

joe (has type P)

angie (has type S)

jackie (has type P)

foo (has type S)

Then the output of this menu option would be (minus the surrounding double quotes): jackie; type = P

joe; type = P

angie; type = S

foo; type = S

Note: the list is displaying the users based first on their type and second on their user name (both alphabetically). Display the user name along with the type.

public class ListUserByTypeAction implements MenuAction {

// implement the process method

}

The process method for the action should return true to keep the user signed in.

Task 3 List Users by Number of Connections

Package: edu.institution.actions.asn6

Class: ListUserByConnectionAction

Add a new method which displays the LinkedIn users, ordered by their number of connections (from most connections to least connections) and display the number of connections they have. For example, if your LinkedIn connections list contains these users:

joe.burns (which has 10 connections)

sam.smith (which has 25 connections)

Then the output of this menu option would be (minus the surrounding double quotes):

sam.smith; connection size = 25

joe.burns; connection size = 10

Note: the list is displaying the users based on who has the most connections. Display the user name along with the connection size.

public class ListUserByConnectionAction implements MenuAction {

// implement the process method

}

The process method for the action should return true to keep the user signed in. Hints on List Users by Number of Connections

If you are at a loss for ideas regarding how to order the list by number of connections (most to least), consider that the Collections class has a sort() method that will take any List and a

Copyright 2020. Doug Estep All rights reserved. Copyright registration number: TXU002159309. 2

Comparator and sort the objects according to how you coded your Comparators compare method.

How You Are Graded

1. The List User Alphabetically option behaves as specified in this assignment (3 points) 2. The List Users by Type option behaves as specified in this assignment (3 points) 3. The List Users by Number of Connections option behaves as specified in this assignment (4 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

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

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

How is coaching similar to counseling? How are the two different?

Answered: 1 week ago