Question
A matrix is given in source data. You have to write user defined functions and create a menu in C++ keeping in mind the following
A matrix is given in source data. You have to write user defined functions and create a menu in C++ keeping in mind the following requirements:
1. Press 1 to display the matrix and its transpose.
(Hint: Transpose of a matrix can be achieved by changing its rows into columns or columns into rows.)
2. Press 2 to find adjoint and determinant of the matrix.
(Hint: To find adjoint of a matrix, we change the places of its diagonal elements and the signs of non-diagonal
elements; To find determinant of matrix, we subtract the product of non-diagonal elements from the product
of diagonal elements.)
3. Press any other key to exit.
Source data:
(Use two dimensional array to store following matrix)
Instructions to write C+program:
Write functions to display the matrix; find transpose, adjoint and determinant of the matrix. Following function names should be used for consistency
Sample Output
1) When 1 is pressed
2) When 2 is pressed
3) When any other key is pressed
To display matrix To show transpose To show adjoint To find determinant showMatrix(); showTranspose(); showAdjoint(); calculateDeterminant();
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
The detailed a...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