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]

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

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!