Question: 1. Create a simple class with one member variable (minimum) and have this class implement the comparable interface in a logical way. Your class will

 1. Create a simple class with one member variable (minimum) and

1. Create a simple class with one member variable (minimum) and have this class implement the comparable interface in a logical way. Your class will also need a constructor and a toString. 2. Create a driver class. a. Copy and paste the insertionSort, swap, and printArr methods from the methods_to_copy.txt file into Main.java. You will need to tweak some types a little and change a few statements to make use of the compareTo method instead of using , but basically the sorting method should work as is. b. In main, declare an array of size 5 to hold objects of your class from Step 1. c. Fill up this array with objects that are "out of order. d. Print the array to show that it's out of order. e. Call the insertion sort method on your array. f. Print out the array again to show that it's *in* order

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!