Reference no: EM133099
Question
Consider an ADT called square matrix. (The Matrix can be represented by a 2-dimensional array of integers with n rows and n columns)
a) write down specification for the ADT as a java interface. Include following operations. (Parameters are already listed for the first two operations; for remaining operation you have to determine which parameters to use yourself. As part of the exercise)-
Make Empty (n), which sets the first n rows and columns to zero.
Store Values (I. j. value), which stores values into the positions at row column j
Add, which adds two matrices together
Subtract, Which Subtracts one matrix from another
Copy, Which copies one matrix from another
b) generate a java class that implements the interface; suppose a maximum size 50 rows and columns.
c) Generate a small application that uses class.