CS111 Lab 8 - StringList Methods

In this lab, you will get experience writing methods that manipulate lists. Rather than using the lists of integers introduced in lecture, in this lab we will be using lists of strings since these will be used in Problem Set 7. The contract for the StringList class is almost identical to the contract for the IntList class the only difference is that the StringList methods use the types String and StringList whereever the IntList methods use the types int and IntList.

Begin this assignment by downloading the file /cs111/download/lab8_programs. Below, you are asked to write several class methods that manipulate string lists. You should write the definitions of each of these class methods in the class LabOps within the file LabOps.java. To test your class methods, you should add testing statements to the main method in the LabOps class. The LabOps class is executed as an application, not as an applet. You need to be careful to quit out of any previous MRJ applications for the class before executing the class again.

Your task is to write and test the class methods described below. Write your methods one-by-one. When you have written a method, write several test statements in main to make sure that your method works in all cases. Don't forget to test your methods on empty lists (if applicable).

Here are the methods that you need to write: