Question: Objective: The goal of this assignment is to practice sorting algorithms. Assignment: In this assignment, you will be implementing versions of two sorting algorithms. You

Objective: The goal of this assignment is to practice sorting algorithms. Assignment: In this assignment, you will be implementing versions of two sorting algorithms. You will use them to sort an array of objects representing cubes. Your first step is to implement a class called Cube that has three double variables to store the length, width, and height of the cube. Then, write a method that calculates the volume of the Cube as a member of the class. All other requirements are listed below Next, you should write a method in a class named Runnerl that will generatea random list of Cubes for testing. The method should take in a number representing the size of the list, and return an array of that many Cubes. Each Cube should have a randomly generated length, width, and height between 0 and . 100. . Implement another method in Runnerl to print out your array of cubes. Yoiu should print a line for each cube listing the length, width, and height and then the volume. As another preliminary step, implement a method CopyArray in Runnerl that . creates a new array of cubes with identical values of a given one. . Now, write two methods inside Runnerl, one named BubbleSort and the other named SelectionSort. Use parameters as you think appropriate. BubbleSort must implement the bubble sort algorithm we discussed in the class and SelectionSort must implement the selection sort algorithm we discussed in class. Note that both BubbleSort and SelectionSort must sort the cubes in the input array in ascending order of the volumes of the cubes. .Demonstrate that your code works by generating a random list of 20 cubes (in arn array), printing out the list before you sort it, and then printing out the list again after it is sorted using BubbleSort. For an identical list of 20 cubes (copied right after the generation of the array that was given to BubbleSort as an input), show the list before and after the use of the SelectionSort method. Write a class named Runner2 that will test the speed of your BubbleSort and SelectionSort methods by recording the time needed to sort an array of different number of cubes (For example, 2000, 3000, 4000, 5000, 6000, and 7000 cubes). Using this data, draw two lines on the same line-plot using MS Excel, one line for Bubble Sort and one for Selection Sort, where x-axis is the number of cubes in the array and y-axis is the runtime. Copy the plot and paste it in MS Word and submit the MS Word file with your source codes. Make a PDF of your MS Word file. Subrmit the PDF file too. Deliverables: Cube.java, Runnerl.java, Runner2.java, MyPlot.docx and for further MyPlot.pdf. You must use Blackboard to submit. Talk to your TA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
