Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in C++ his project you will be defining a Template Matrix class in C++ and equip the class with a few matrix , and

Answer in C++

image text in transcribed

his project you will be defining a Template Matrix class in C++ and equip the class with a few matrix , and the main function operations. If the code does not compile-no credit is given. The code must compile execute successfully The Matrix class must have the following private data members at l east 1. A variable to represent rows for the number of rows of the matrix ariable column for the number of columns of the matrix A pointer variable data to point to the matrix data The Matrix class must also have the following member functions 3. A default constructor - this constructor initializes the row and column of the matrix to 3, then dynamically allocates memory Matrix elements to random integers between 0 and 10 A constructor with parameters- The parameters to the constructor are used to initialize the rov and column variables. This constructor dynamically allocates memory for the elements of the matrix. The constructor also initializes the Matrix elements to random integers between O and 10 for the elements of the matrix. The constructor also initializes the 3. A correct destructor method called display) that displays the matrix in proper row/column form exception handling with object out_of range for the case when i or j or both are out of bound 5. The method getElement(int i, int j) that will return the (ij) element in the matrix. Include The method setElement ( int i, int j, int value) that set the (Gj) element of the matrix to the value Include exception handling with object out_ of_ range for the case when i or j or both are bounds. 7. The method for the addition of one matric object to another add(Matrix a) that receives a Matrix t a and adds it to the implicit object and returns another Matrix object. Include exceptions if objec matrices cannot be added (e.g. in the case of incompatible types or dimensions) The method multiply multiply( Matris a) that receives a Matrix object and multiplies it to the 8. plicit object and returns another Matrix object. Include exceptions if matrices cannot be tiplies (incompatible dimensions). An algorithm for matrix multiplication is given on page im 205 of your textbook. 9. Overload the out stream operator 10. Overloa 11. Make proper use of const and references , for the Matrix class to display a Matrix Object t d the in stream operator "" for the Matrix class to receive elements for a Matrix object. Write a main( ..) method to text the Matrix class. The main...) method must includ 1. Declare two 3x3 matrices 2. Test setElement) and getElement) methods 3. Test the exceptions by using invalid parameters 4. Use the operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Write an elaborate note on marketing environment.

Answered: 1 week ago

Question

1. Explain why evaluation is important.

Answered: 1 week ago