Question: The program has to be in Java Console. 1) (10 points] You've been hired by Sort Scorchers to write a Java console application that sorts
![The program has to be in Java Console. 1) (10 points]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f024edd432e_12566f024ed33f0e.jpg)
The program has to be in Java Console.
1) (10 points] You've been hired by Sort Scorchers to write a Java console application that sorts an array list of random real numbers. Use a validation loop to prompt for and get from the user the number of real numbers to sort in the range 10-10,000. Create and store in the array list that many random real numbers. Randomly generate the real numbers in the range 0-1,000. Print the array list size and use formatted output to print the first ten values of the array list in two columns: The first column is the zero-based index of the value. . The second column is the right-justified value. Use the insertion sort method to sort the array list. Monitor the number of cycles and swaps during the sort, and the elapsed time in milliseconds to complete the sort. Use formatted output to print the results (cycles, swaps, total cycles and swaps, and elapsed time) in two columns: The first column is a left-justified label. Include units if needed. The second column is a right-justified value. Print the array list size and first ten values of the array list again. Format all numbers with a comma. Format all real numbers to one decimal place. Run the program three times with the following inputs. Enter the elapsed times for each run: Run Array list size Elapsed time (ms) 10 5,000 10.000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
