Question: PLEASE HELP IN JAVA: Using the input file called StudentInputFile.txt, input these students into a linked list sorted according to their age. In each case

PLEASE HELP IN JAVA:

Using the input file called StudentInputFile.txt, input these students into a linked list sorted according to their age. In each case I made the student's last name their age as a string so when the input file says "John" "Twenty" 20 this means the student's first name is John, last name is Twenty, and age is 20. This is so that when you output the list you can easily tell if it is sorted by looking at the last names.

I have given you a class called Student. You will have to add a compareTo method so this class can implement comparable. Do NOT add a getAge() method to the class. In main I want you to be able to compare two Student objects.

Do not use an array or any other data structure other than the list. Do not add them to the list and then sort the list. I want you to add each node to the list in the "correct" place in order to keep the list sorted as you are building it. Then output the contents of the list.

studentInputFile.txt:

Marty Twenty 20

Elizabeth Fifty 50

Christy Nineteen 19

Graham TwentyFive 25

Doris FiftyOne 51

Eleanor ThirtyFive 35

Mark Nineteen 19

Margaret Forty 40

Jessica ThirtyOne 31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!