Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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 objects

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

Students also viewed these Databases questions

Question

b. Will there be one assigned leader?

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago