Roster with Comparators
HW04-1 Roster with Comparators • In a new Eclipse project, create class Student with these four instance variables: String lastName, String firstName, int studentID, and int birthDate [as YYYYMMDD [ e.g., 19980420]. Student should have a constructor with four parameters, four getters, and a toString(). [Use Eclipse “source” shortcuts to code all this FAST!] Add a class Main with a main() driver that: 1. builds an ArrayList of called roster with, say, ten unique entries. Take care that your sample data will be initially ordered so that each of the sorts will change the original ordering. 2. defines five lambdas that use Comparator for ordering by: lastname-ascending birthdate-descending [youngest first] studentID ascending, and studentID-descending –Challenge: check java api or some external reference and try to create a fifth lambda using the Comparator interface to sort by birthdate-descending with lastnameascending as a secondary sort if birthdates are equal. Cite the reference you used to get the syntax for this! 3. Invoke sorts with each of the Comparators, and for each, begin by outputting the descriptive name of the Comparator (e.g., “by lastname-ascending”) then display the results. Note: Feel free to organize class Main with some methods like displayList(…), but don’t get carried away. Key idea: “hardwire” each invocation of a sort –e.g.: roster.sort(studentID_desending); We don’t want an elaborate driver for this little exercise! Deliverables: zip of completed Eclipse project and Word doc with screen shots showing output from test run(s). Be sure to include the required Javadoc header declaring any collaboration on this assignment. OOPDA HW04-1 SP23 2/11/2023 1:27 PM
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.