This assignment will continue the encapsulation practice from a previous lab exercise, and also give you a chance to write code for unit testing.

You will add to the Matrix NetBeans project created in the previous lab exercise.

Your tasks for this assignment are:
To implement the actions, complete the fillRowWise, fillColumnWise, makeIdentity, and transpose methods that were defined, but not implemented, in the Matrix interface given to you in the previous lab exercise (shown below — the methods in question are at the bottom).

How these actions work are described via the menu shown to the left.

You will test your actions through both unit tests and by demonstrating them in a GUI.
Run the provided MatrixTest.java file shown below.
Once all your unit tests succeed, run the provided MatrixControlTest.java file found in the gui test package to get the tool shown below. You should be able to demonstrate all your actions through the Actions choicebox.

To implement the operations, complete the equals, add, and multiply methods that were defined, but not implemented, in the AbstractMatrix class given to you in the previous lab exercise and shown below.

How these actions work are described via the menu shown to the left.

Pay particular attention to the Javadoc comment for the equals method. You need to cast the Object parameter to Matrix before using it. Generally, you need to check the type before casting, but our tests only send Matrix objects, so in this case type checking is not necessary.

You will test your operations by both writing and executing unit tests and by demonstrating them in a GUI.
Uncomment the testEquals, testAdd, and testMultiply methods that are defined in MatrixTest.java, shown below (the methods are at the bottom).

Now provide implementations for them:

Try to make your tests as exhaustive as possible — remember that the goal of testing is to expose bugs.

Run the MatrixTest.java file again. This time 12 tests should succeed.

Once all your unit tests succeed, run the provided MatrixOperationTest.java file found in the gui test package to get the tool shown below. You should be able to demonstrate all your operations through the Operations choicebox.

The additional files required for this assignment, beyond those used in the previous lab exercise, are available from the menu on the left.
MatrixTest.java

As in the Encapsulation Lab exercise (see menu at left), when your matrix project is working correctly, use the Export Project > To ZIP... file feature to create Matrix.zip and submit it to .

Your project will be inspected and run by the lab instructor. Grading criteria:

Note the general Submission Policy in the menu at left.