Question
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started