Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For each of the operations (Addition, Subtraction, Multiplication, Determinant, Transpose and Inverse), make a function in addition to two other functions for Inputting and Displaying

For each of the operations (Addition, Subtraction, Multiplication, Determinant, Transpose and Inverse), make a function in addition to two other functions for Inputting and Displaying the Matrices in Row-Order Format. (In total there will be 8 functions: 6 for the operations and 2 functions for inputting and displaying the data.)

For Addition, Subtraction, Multiplication, and Transpose, it can be 2D array of any size (say Max dimension for both row and Column be 10). So, to prevent users from having to entering 100 (for a 10X10 matrix) elements every time (even for a smaller matrix), you should ask for the number of rows and columns in the matrix before the user would input the values of the matrix elements. Basically, your code should be generic. The point is user should be free to enter 2X3, or 4X2, or 9X9 Matrix. If the operation is not supported (ex. adding two arrays of different dimensions) just print out that the operation is not supported and return to the menu.

For Determinant and Inverse operations, we are giving you the relaxation to choose fixed matrix size of 3X3. (3 rows and 3 column). You do not need to calculate the determinate and inverse operations for any matrix that is not 3x3 (the function can just check to see if the matrix not 3x3. If it is, just print out that the operation is not supported).

Requirements: In the main function you should have a menu in which you will ask the user his or her choice for which of the operations he or she wants to perform. For Ex.

cout

cout

cout

.....

cin>>choice;

After taking the choice value, one should have a switch network to choose which function (for the matrix operation) needs to be called.

I need the inverse function and how to call it in main. It has to work for a 3x3 matrix

Here is the display,input, det function and the main im using

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

#include iostream #include using namespace std; // input void input (int arr[][10], int row, int col) for (int x e; x row; x++) { for (int y 0; y arr[x][y]; //display matrix void display (int arr][10], int row, int col) cout choice; int r1, c1, r2, c2; int mat1[10][10], mat2[18][10], mat3[10][10]; cout " "; else if (choice 4) cout > rl; cout > cl; if (ri> 10 | c1 > 10) # of columns: "; cout

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago