Question: Complete the assignment below, DO NOT IMPORT JAVA.UTIL we are not allowed to import array, list, linked list, array list, if you want to use

Complete the assignment below, DO NOT IMPORT JAVA.UTIL we are not allowed to import array, list, linked list, array list, if you want to use them make a class that implements them

Code is in Java

The problem: an only slightly confused number and symbol sorter

The task your system has to perform is to sort a given list of natural numbers and symbols in descending order. In addition to the usual ordering on natural numbers, we have the following requirements on how the symbols are integrated:

  • 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).

Input file

In an input file the given list for your system will be given by a line for each of the numbers/symbols in the list.

Output file

In the output file, you output the result list one number/symbol in its own line in the required order. If during reading of the input list, your system encounters an input that is not a natural number or one of the symbols given above, it has to output: Input error. and terminate. Regarding blanks and empty lines, the same requirements as in assignment 1 have to be fulfilled.

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!