Question: C++ Long Programming Challenge Excercise. Need help implementening header file and .cpp implementation. Class defined is: No makefile necessary The Header file: #ifndef MATRIX_H #define

C++ Long Programming Challenge Excercise. Need help implementening header file and .cpp implementation.

Class defined is:

No makefile necessary

C++ Long Programming Challenge Excercise. Need help implementening header file and .cppimplementation. Class defined is: No makefile necessary The Header file: #ifndef MATRIX_H

#define MATRIX_H #include using namespace std; class Matrix { public: Matrix(unsigned r,unsigned c); Matrix(const Matrix& rhs); ~Matrix(); // Insert overloaded = operator signature// Access the individual elements of a matrix: insert overloaded operator signatures// Matrix mathematical operations: insert overloaded operator signatures // Linear equations: insertoverloaded operator signatures // Getters and setters: unsigned getRows() const; // Returnnumber of rows unsigned getCols() const; // Return number of columns private:// Insert helper function signatures if necessary double ** matrix; // the

The Header file:

#ifndef MATRIX_H #define MATRIX_H

#include

using namespace std;

class Matrix { public: Matrix(unsigned r, unsigned c); Matrix(const Matrix& rhs); ~Matrix(); // Insert overloaded = operator signature

// Access the individual elements of a matrix: insert overloaded operator signatures

// Matrix mathematical operations: insert overloaded operator signatures // Linear equations: insert overloaded operator signatures // Getters and setters: unsigned getRows() const; // Return number of rows unsigned getCols() const; // Return number of columns

private: // Insert helper function signatures if necessary

double ** matrix; // the matrix array unsigned rows; // # rows unsigned cols; // # columns };

#endif

6.1 Task 1: Implementing the Matrix File matrix.h contains an incomplete header of the Matrix class that you will implement for this task. A two-dimensional dynamic array is used to store the matrix data. The dimensions of the array are stored in two member variables: rows and cols, which stand for rows and columns, respectively. 6.1.1 Constructors Matrix constructor takes two unsigned int parameters, representing the number of rows and columns in the matrix. Upon receiving the dimension parameters, the constructor must allocate a dynamic array of the given size, and fill it with zeros. Remember to implement a destructor to deallocate the memory when the program exits. In addition to the constructor, implement an appropriate copy constructor, and overload the assignment operator to enable assigning Matrix objects to one an other

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!