Write a complete Java application that reads a file with erroneous integer values, filters the faulty...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these computer network questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Declare and assign these variables as shown (all your code must appear in the body of the main method): String firstName = "Blueberry"; String lastName = "Strawberry"; In addition, declare and...
-
Expected manufacturing costs for Imperial Data Devices are as follows: Variable Costs Fixed Costs per Month Direct material $8.00/unit Supervisory salaries $17,000 Direct labor 3.50/unit Factory...
-
In Fig. 6-6a, assume the distance axis is linear and that dA = 10.0m and dB = 35.0m. Estimate the work done by force F in moving a 2.80-kg object from dA to dA.
-
Provide an example of how poor escalation of a project problem can create additional problems.
-
In general how have interest rates changed since the late 1980s according to Figure 11.1? FIGURE 11.1 Interest and Inflation Rates, 1988-2010 10p Rate (%) 8 6 10-Year Treasury Bonds 4 2 AAA Corporate...
-
Using net present value and internal rate of return to evaluate investment opportunities Veronica Tanner, the president of Tanner Enterprises, is considering two investment opportunities. Because of...
-
Blossom Corp. obtained a tradename in January 2024, incurring legal costs of $72,720. The company amortizes the tradename over 8 years using the straight-line method. Blossom successfully defended...
-
Branson Co. received its bank statement for the month ending May 31, 2022, and reconciled the statement balance to the May 31, 2022, balance in the Cash account. The reconciled balance was determined...
-
Mathis Co. at the end of 2014, its first year of operations, prepared a reconciliation between pretax financial income and taxable income as follows: Pretax financial income $ 500,000 Estimated...
-
The Uptowner will pay an annual dividend of $3.26 a share next year with future dividends increasing by 2.8 percent annually. What is the market required rate of return if the stock is currently...
-
Suppose a 5 -year, $ 1 , 0 0 0 bond with annual coupons has a price of $ 1 , 0 5 0 and a yield to maturity of 6 % . What is the bond's coupon rate?
-
Phil can afford $240 a month for five years for a car loan. If the interest rate is 8.5 percent, how much can he afford to borrow to purchase a car?
-
The document which tracks the stages of production of a unique job in a manufacturing comapby and on which costs can be recorded as they ate expended ,what is called that cost?
-
On October 1, 2024, the Allegheny Corporation purchased equipment for $332,000. The estimated service life of the equipment is 10 years and the estimated residual value is $2,000. The equipment is...
-
1) A Bank teller in Orange County Bank observed for 20 days made these overpayment errors while serving bank customers. The errors in dollars balances have been used to develop this sample frequency...
-
Is that Yelp review real or fake? The article A Framework for Fake Review Detection in Online Consumer Electronics Retailers (Information Processing and Management 2019: 12341244) tested five...
-
Larry and Lisa Williams, both 33 years old, have been married for 9 years. They live at 638 Arctic Way, Fairbanks, AK 99701. Lisa's Social Security number is 445- 81-1423 and Larry's is 798-09-8526....
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
Larry Gaines, age 42, sells his personal residence on November 12, 2012, for $144,000. He lived in the house for 7 years. The expenses of the sale are $10,500, and he has made capital improvements of...
-
Define terrorism.
-
Congress has prohibited the provision of material support or resources to certain foreign organizations that engage in terrorist activity. 18 U.S.C. 2339B(a)(1) . . . The plaintiffs in this...
-
Following a six-day trial in March 2008, a jury convicted Defendant Hassan Abu-Jihaad on two charges: (1) disclosing national defense information to those not entitled to receive it in violation of...
Study smarter with the SolutionInn App