Lab #3: Object-oriented programming essentials Get this lab checked off by a TA during the week of 20 September. 1. Be sure you have all the files associated with this lab, which are DIRECTIONS This file Makefile The makefile controlling compilation and testing Tester.java A main program that uses SimpleLists SimpleList.java A class representing a sequence of items ListEntry.java Used in the implementation of SimpleList test1.in, test1.out Input script and expected output for testing. 2. Compile the programs (using gmake) and run Tester by hand with java Tester < test1.in to see what it outputs, and also check the output with gmake check to see what that is supposed to produce. Try temporarily modifying test1.out (just change a character and save it) and run 'gmake check' again to see what happens in the case of an error (be sure to change test1.out back!). Finally, try running just 'java Tester' without the input redirection ("< test1.in") in order to understand what all those '>'s are doing in test1.out (you can look in test1.in to see possible commands to type). 3. Add another test input and output file. Try to make the tests reasonably thorough. 4. The SimpleList class (and its "helper" class ListEntry) assume you are dealing with Strings. However, essentially the same code should work for any classes that contain a compareTo method, that is, that implement the standard java.lang.Comparable interface: public interface Comparable { /** Compares this object with the specified object for order. * Returns a negative integer, zero, or a positive integer * as this object is less than, equal to, or greater than * the specified object. (Throws an exception if the * Objects are incomparable for some reason.) */ public int compareTo(Object o); } Modify SimpleList.java and ListEntry.java as needed so as to work on Comparable items, not just Strings. 5. Turn the SimpleList class into an interface called SimpleList (containing the public methods) and a class called LinkedList1 that implements the interface. Modify the Tester.main method as needed to make things continue to compile and work correctly. (Put LinkedList1 into file LinkedList1.java) 6. Copy LinkedList1.java to LinkedList2.java, and modify LinkedList2.java so that its class is called LinkedList2. 7. Modify LinkedList2.java to remove the private methods, and make all the methods non-recursive. That is, re-implement the methods using loops (while or for). 8. Modify Tester.main to test the LinkedList2 class, changing ONLY Tester.main. 9. Copy LinkedList2.java to LinkedList3.java, and again modify to make the class name LinkedList3. Again, modify Tester.main to test it. We are now going to re-implement LinkedList3 in two stages: First we'll make a class to PARTIALLY implement SimpleList, leaving certain crucial methods unimplemented (abstract), and using these abstract methods to implement the remaining methods. Then, we'll re-implement LinkedList3 as an extension of this partial implementation, filling in the abstract methods. 10. Create an abstract class AbstractSimpleList that implements SimpleList (in file AbstractSimpleList.java). In this class, put implementations of add(*) (the one-argument method) and isOrdered(), leaving as abstract the public definitions of get(*), length(), and add (*, *). The AbstractSimpleList class must contain no variables (neither instance nor static variables). You may have to re-implement the add(*) and isOrdered() methods to use only the other (abstract) public methods, and not mention the instance variables. 11. Now re-implement the LinkedList3 class by having it extend AbstractSimpleList and then override only the abstract methods. Keep the same things private that were private in the original SimpleList class. As always, test. 12. Show what you've done to your TA for check-off. Be prepared to explain your own work, of course, but also how Tester.java works, and how the Makefile works.