Consider an adt called square matrix the matrix can be


Consider an ADT called square matrix. (The Matrix can be represented by a two-dimensional array of integers with n rows and n columns)

a) Write the specification for the ADT as a java interface. Include the following operations. (Parameters are already listed for the first two operations; for the remaining operation you must 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) Create a java class that implements the interface; Assume a maximum size 50 rows and columns.

c) Create a small application that uses the class.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Consider an adt called square matrix the matrix can be
Reference No:- TGS01606664

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)