Answer to Question #335506 in C++ for jweoij

Question #335506

Implement a class Matrix to create matrices of 2x2, 3x3 and 4x4 with the following private

datamembers:

1. int **matrix – a double pointer of type integer to create a 2D array (matrix)

2. int row – an integer to store the rows in the matrix

3. int col – an integer to store the columns in the matrix

The class shall have the following public member functions:

1. Matrix Add(Matrix m) – adds the calling object matrix with the one passed as an argument and returns a resultant matrix

2. Matrix Subtract(Matrix m) – subtracts the calling object matrix with the one passed as an argument and returns a resultant matrix

3. Matrix Multiply(Matrix m) – multiplies the calling object matrix with the one passed as an argument and returns a resultant matrix

4. int FindkSmallest(int k) – a function that finds the kth smallest element in the matrix. If k is 1, return the smallest element. If k is 2 return the second smallest element and so on.

5. Matrix merge(Matrix m) - a function to merge two matrices.


0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS