Answer to Question #49934 in C++ for yolanda

Question #49934
(CODEBLOCKS)
Write a program that takes as input two 3x3 2-D arrays and write the following two functions:
a. getInpt(.): this functions takes input from the user and fills the matrix (or a 2D
array).
b. print(.): this function takes a 2-D arrays as the formal parameter and prints the
results on the screen.
c. addMat( , , ): this function takes two 2-D arrays (or matrices) and finds the sum
of the two matrices and stores the results in the third formal parameter.
d. multMat( , , ): this function takes two 2-D arrays( or matrices) and finds the
product of the two matrices and stores the results in the third formal parameter.
You can use the following main method.
int main( ) {
int mat1[rows][cols], mat2[rows][cols], res[rows][cols];
cout<<"Please enter a 3x3 matrix: "; getInput(mat1);
cout<<"Please enter a 3x3 matrix: "; getInput(mat2);
addMat( mat1, mat2, res);
cout<<"\nSum of matrices: ";
print(res);
multMat( mat1, mat2, res);
cout<<"\nProduct of matrices: ";
print(res);
return 0;
1
Expert's answer
2014-12-10T13:16:48-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-49934.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS