Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Need help with C++ HW. In the main function please print out the matrix done by different operations! For this homework exercise you will be
Need help with C++ HW. In the main function please print out the matrix done by different operations!
For this homework exercise you will be exploring the implementation of matrix multiplication using C++ There are third party libraries that provide matrix multiplication, but for this homework you will be implementing your own class object and overloading some C++ operators to achieve matrix multiplication. 1. [10pts] Create a custom class called Matrix a. Private Members i. int rows; ii. int cols; ii. double* data; b. Provide NO default constructor c. Constructor i. Matrix(int,int) takes rows and cols ii. Inside constructor allocate and initialize data d. Destructor i. Matrix( ii. Inside destructor delete memory allocation of data completely 2. [10pts] Overload Copy constructor 3. [10pts] Overload> a. For input, user inputs the values of the matrix in row then column format i. HINT: using a space you can separate column data and enter for row b. For output, use tab and return line to create a matrix-like output 4. [10pts] Overload the assignment operator () 5. [20pts] Overload +), (+), (), and ( operators and (++), () for post and pre type 6. [30pts] Overload the () operator to perform matrix multiplication. a. Check the dimensions of both matrices to ensure proper dimensions, output an error on cerr and exit(1) if dimensions are invalid. b. Must be able to work on any 2 valid matrices. 7. [10pts] Program Correctness a. Prompt user for number rows and columns for two matrices. b. Prompt the user to enter data for these matricesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started