Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code is in Java. Ensure the input and output files are done through the command line arguments. Output file should have no blank lines. Any

Code is in Java. Ensure the input and output files are done through the command line arguments. Output file should have no blank lines. Any blank lines in input file are to be disregarded.

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
  • 100
  • 1000
  • 3
  • 3
  • 1005000
  • 55
  • 20
  • 15
  • 103
  • One
  • One

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.

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions