Assignment #3 Instructions

Extend the ArrayIntList class being developed in class and chapter 15 of the book by adding a method called indexOfSubList() that accepts another list L as a parameter and returns the starting index of where L first appears in this list, or -1 if the value is not found in the list. For example, if variables called list1 and list2 store [11, -7, 3, 42, 0, 14] and [3, 42, 0] respectively, the call of list1.indexOfSubList(list2) should return 2.

This is problem #2 in the exercise section of the book chapter 15. :)

You may use the book as a reference but try as much as possible to do the work and create the code on your own. Do NOT just copy example code from the book!

You may not directly use Arrays class methods ... you must write your own algorithms.

You must make "reasonable" attempts to ensure arguments (indices, capacities) are valid.

Name your new class <your name>_Assign3.java.

Use the provided main program tester to verify your ArrayIntList class is correct.

Your program must EXACTLY match the designated output found in Assign3Output.txt. Make sure you use the output comparision tool!

Submit the assignment 3 source code file to me as usual via DropItToMe

Follow class programming standards and formatting/indentation rules. Make sure you comment your code! In your method headers you must include pre and postconditions.

Assignment Grading

The assignment is worth 35 points.

This is pretty simple...you get 100% if your output exactly matches the expected output...and...0% if it has ANY differences.

Make sure you get all the spelling, capitalization, punctuation, spacing, etc. correct! Hint: copy-n-paste is a wonderful thing! :)