Please use C++
Posted: Thu Jul 14, 2022 2:27 pm
Please use C++
Matrix Addition and Subtraction: In this lab, you are going to implement a matrix calculator. Theory: Adding matrices Given A=[4387] and B=[1502], let's find A+B. We can find the sum simply by adding the corresponding entries in matrices A and B. This is shown below. A+B=[4387]+[1502] =[4+13+58+07+2]=[5889]
For example, let's consider C=[2089] and D=[51163] We can find C−D by subtracting the corresponding entries in matrices C and D. This is shown below. C−D=[2089]−[51163]=[2−50−118−69−3]=[−3−1126] Task: 1. Ask the user about what kind of operation he/she likes to do. If the user press "a" then perform addition or for "s" perform subtraction. End the program with an error message fo other character input. 2. Take two matrix inputs. Each matrix should be 2×2 size. 3. Display the input matrices and output matrix properly.
Matrix Addition and Subtraction: In this lab, you are going to implement a matrix calculator. Theory: Adding matrices Given A=[4387] and B=[1502], let's find A+B. We can find the sum simply by adding the corresponding entries in matrices A and B. This is shown below. A+B=[4387]+[1502] =[4+13+58+07+2]=[5889]
For example, let's consider C=[2089] and D=[51163] We can find C−D by subtracting the corresponding entries in matrices C and D. This is shown below. C−D=[2089]−[51163]=[2−50−118−69−3]=[−3−1126] Task: 1. Ask the user about what kind of operation he/she likes to do. If the user press "a" then perform addition or for "s" perform subtraction. End the program with an error message fo other character input. 2. Take two matrix inputs. Each matrix should be 2×2 size. 3. Display the input matrices and output matrix properly.