Array Practice

due: Monday, October 21

70 points + a possible 10 extra credit points

The purpose of this exercise is to practice with arrays and static methods. It is strongly recommended that you complete the assignment on time, because it will serve as very good practice for your second midterm.

Please download this zipped Eclipse project. Just as you did with the String Practice Assignment, import it into Eclipse by choosing File -> Import -> General -> Existing Projects into workspace -> Select archive file. Open the project and its included source file ArrayPractice.java. You'll find that it contains several methods that have not yet been finished. For now, the methods contain only a placeholder return value so that the code will compile. Fill in your own implementation.

Just as in the String-practice assignment, you do not have to write a main() to test your code. Many of the tests have been written for you using the JUnit testing framework. These are found in ArrayPracticeTest.java.

As in a previous assignment, in order to run your tests, open the file that contains the unit tests (ArrayPracticeTest.java), and click the run button. Before you've written any of your own code, the methods will all be broken, the tests will fail, and you'll see output like:

tests failed image

but after your code is completed and working properly, you'll see:

tests failed image

Some assorted notes

Do not modify any files in the project other than ArrayPractice.java. Do not use the Arrays class in your methods. Do not change the return types, names, or parameters of any of these functions or of the name of the class itself. There is also no need in this assignment for any global variables. In short, you will be modifying the body of each of these functions.

what to submit

When you're finished, upload to canvas either the .java files that include your implementation of the methods. You may instead zip your entire project folder and upload the zip file to Canvas.

It's a good idea to confirm through the Canvas submission page that what you've intended to submit was uploaded. We will grade what you submit. If you submit a corrupted, empty, or otherwise incorrect file, this is what we'll grade. It is your responsibility to verify through the Canvas submission page that you've submitted the correct files and that they were uploaded properly.

Here's a Canvas tutorial on how to submit files.