Question: Do not import array, list, linked list, array list, or any sorting method. Code is in Java. There is an input file that has one
Do not import array, list, linked list, array list, or any sorting method. Code is in Java. There is an input file that has one element per line, with no blank lines. The objective of this code is to sort the input file according to a rubric, and then output that sorted list. Use any sort method you want, and put the input into either a linked list or an array. You have to sort natural numbers in descending order, and the strings and characters by the rubric below
If there is an input in the input file that is not a natural number or one of the symbols below, output Input Error and terminate.
This is the method as to how the input file is to be sorted to create an output file.
- 0 < Do < 1
- 100 < Re < 101
- 1000 < Mi < 1001
- 3 < & < 4
- 3 < @ < &
- 1005000 < % < 1005001
- 55 < Asymbolwithareallylongname < 56
- 20 < $ < 21
- 15 < Fa < 16
- 103 < One < 104
- One < Three < 104
- One < Two < Three
If the given list contains any number of 666, then the result list should be sorted in ascending order, without any occurences of 666, but with one @ added (even if the list already contains @s).
The output file is similar to the input file in that it is one element per line, with no blank lines.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
