Question
Write a C++ program for finding whether the matrix is a Quattro Matrix or not. Quattro Matrix: The Matrix which the values on the corners
Write a C++ program for finding whether the matrix is a Quattro Matrix or not. Quattro Matrix: The Matrix which the values on the corners are equal to the sum of the values around them. 53122 (0,0) = 0,1)+(1,0) + (1,1) (0.3) = 0.2) + (1.2) + (1,3) 0 2 14 (3.0) =(2,0) +(2,1)+(3.1) 4 4 (3.3) = 2.2)+(2,3)+(3.2 146 9 Create a Matrix class which has a 2-d array(4x4) as a private member variable, a constructor a destructor, overloaded input, output, addition and subtraction operators. This Matrix class can be used for both integer and double data types, so you should use class template The constructor will output a message which tells a Matrix object has been created. The destructor will output a message which tells a Matrix object has been destroyed. User should input values for the Matrix and you should be checking that all the values entered by the user are between 0-25. If the value is not between 0-25 you should output an error message and assign a value randomly between 0-25. The assigned random value will only be integer you don't have to deal with double random values. The overloaded summation and subtraction operators should perform the operation by summing or subtracting the same indices from each other. Sample Summation of 2x2 Matrix (C(0,0) = A(0,0) + B(0,0)) (C(0.1) = A(0,1)+ B(0,1)) (C(1,0) = A(1,0) +B(1,0)) (C(1,1) = A(1,1) + B(1,1)) The output operator should output the Matrix(4x4) row by row- You should create 2 objects and fill them in. Then you should ask which operation to be handled. '+' for summation -- for subtraction. You should perform the entered operation and then you should store the result in another object. You should output the resultant Matrix. Finally, you should check whether it is a Quattro Matrix or not. If it is a Quattro Matrix then you should output a message. Finally you should destroy all the objects.
Write a C++ program for finding whether the matrix is a Quattro Matrix or not. Quattro Matrix: The Matrix which the values on the corners are equal to the sum of the values around them (0,0) = (0,1)+(1,0) + (1,1) 53122 (0.3) = 0.2)+(1,2)+(1.3) (3.0) = (2,0) + (2,1)+(3,1) 4 4 (3.3) = 2.2)+(2,3)+(3,23 14 619 Create a Matrix class which has a 2-d array(4x4) as a private member variable, a constructor, a destructor overloaded input output, addition and subtraction operators, This Matrix class can be used for both integer and double data types. so you should use class template. The constructor will output a message which tells a Matrix object has been created, The destructor will output a message which tells a Matrix object has been destroyed. User should input values for the Matrix and you should be checking that all the values entered by the user are between 0-25. If the value is not between 0-25 you should. output an error message and assign a value randomly between 0-25. The assigned random value will only be integer you don't have to deal with double random values. The overloaded summation and subtraction operators should perform the operation by summing or subtracting the same indices from each other Sample Summation of 2x2 Matrix (CC0.0) = A(0,0) +B(0,0)) (CC0.1)= A(0.1) +B(0.1)) C(1,0) = A(1,0) + B(1,0)) (C(1.1) = A(1.1) +B(1,1)) The output operator should output the Matrix(4x4) row by row, You should create 2 objects and fill them in. Then you should ask which operation te be handled. '+' for summation for subtraction. You should perform the entered operation and then you should store the result in another object. You should output the resultant Matrix. Finally you should check whether it is a Quattro Matrix or not. If it is a Quattro Matrix then you should output a message. Finally, you should destroy all the objectsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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