CASE STUDY^617
Matrix one = newMatrix(data1);
Matrix two = newMatrix(data2);
Matrix three = newMatrix(data3);
Matrix four = newMatrix(data4);
try
{
outFile.println("Matrix one:");
one.printMatrix(outFile);
outFile.println("Matrix two:");
two.printMatrix(outFile);
outFile.println("Result of adding one and two:");
result = one.add(two);
result.printMatrix(outFile);
outFile.println("Result of subtracting two from one:");
result = one.sub(two);
result.printMatrix(outFile);
outFile.println("Matrix three:");
three.printMatrix(outFile);
outFile.println("Matrix four:");
four.printMatrix(outFile);
outFile.println("Result of multiplying three by four:");
result = three.multiply(four);
result.printMatrix(outFile);
outFile.println("Result of multiplying four by three:");
result = four.multiply(three);
}
catch(MatException except)
{
outFile.println(except.getMessage());
}