Question: Write a complete Java application that reads a file with erroneous integer values, filters the faulty inputs and outputs the rest sorted. The rules
Write a complete Java application that reads a file with erroneous integer values, filters the faulty inputs and outputs the rest sorted. The rules that you must follow is given below: Input file name will be given as a command line argument. However, if it is not provided from the command line, your program should ask the user to enter the input file name until it gets a valid file name. The input file contains integer values one per line, some of them are invalid. Read each line and extract integer values. Your program should handle the exceptions that may arise and be able to read every valid integer value until the end of file. You are not given the number of integers that the input file contains. That is your program detects the end-of-file. Write a separate class IntSort. IntSort has a constructor which takes an unsorted integer array as a parameter, sorts the integers in the given array and stores the sorted array as a class attribute. IntSort has another method which returns the integer array containing the sorted integers. You may use any sorting algorithm. As the second part of your homework, write another Java application that handles the floating point numbers according to the above given rules. (100 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
