Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i having trouble with writing this code. I am in a beginning C plus plus class.

ID: 3714478 • Letter: I

Question

i having trouble with writing this code. I am in a beginning C plus plus class. We are studying arrays and i am using Microsoft Visual Studios. with #include<iostream>,#include<iomanip>,#include<cmath>. I have to use arrays in order to write the code. thank u
thank you

4. Write a program that reads in a 3 X 3 square matrix and prints out the determinant of the matrix. 5. Write a program that reads in three matrices A, B and C and calculates the following 1 2-1 0 32 0 2 -1 2* A+3*B

Explanation / Answer

For first question:

For Second question:

/*

* C++ Program to compute 2*A + 3*B

*/

#include<iostream>

#include<math.h>

#include<conio.h>

using namespace std;

int main()

{

int m,n;

cout<<"enter the row of matrix" ;

cin>>m;

cout<<"enter the column of matrix" ;

cin>>n;

double mat1[10][10];

double mat2[10][10];

double mat3[10][10];

int i, j;

cout<<"enter the elements of A"<<endl;

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

cin>>mat1[i][j];

}

}

cout<<"enter the elements of B"<<endl;

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

cin>>mat2[i][j];

}

}

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

mat3[i][j]= 2 * mat1[i][j] + 3 * mat2[i][j];

}

}

//print

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

cout<<" " <<mat2[i][j]<<" ";

}

cout<<" ";

}

  

getch();

}