Question: It is required to design and implement a matrix calculator that supports all necessary operations that can be done on Matrices. Operations that will be



It is required to design and implement a matrix calculator that supports all necessary operations that can be done on Matrices. Operations that will be supported in this first milestone are: 1- Addition of two matrices 2- Subtraction of two matrices 3- Multiplication of two matrices 4- Multiplying matrix by a scalar REMOVED THE DIVISION Input Format The matrix should be entered by the user in the following format: [1 2 5, -18 14.2, 7.01 - 18 99.3] which is the format equivalent to a 3x3 matrix as shown: 1 2 5 -1 8 14.2 17.01 -18 99.3 User can choose between the different operations as follows: In case of Addition: user uses '+' symbol between the two matrices as follows: [1 2 4, 4 7 8] + [-5 3 5, 7 6 1] The first matrix is in a line, then the operator on a new line, and finally the second matrix is also on a new line. The ouput must be in the following format: (Will be printed on a whole new line) [1 2 4, 4 7 8] + [-5 3 5, 7 6 1] [-4 5 9, 11 13 9] In case of subtraction: user uses '-' symbol between the two matrices. In case of multiplication: user uses '* ' symbol between the two matrices: 1. In case of multiplication of a matrix by a scalar, the user can begin with either the matrix or the scalar (as he wishes), with the multiplication operator between them. [1 2 4, 4 7 8] -1 [-1 -2 -4, -4 -7 -8] * [1 2 4, 4 7 8] [4 8 16, 16 28 32] 2. In case of multiplication of a matrix by another matrix, the input is done as similar to the addition and subtraction step. (But be aware of the dimensions in multiplication!!) REMOVED DIVISION Constraints User will input string as shown previously: Example for a 3x4 matrix, it should be witten as follows [-0.1 2 5,-18 14.2, 7.01-18 99.3, 15.0-99.24 18] User will input the matrix of size nxm; where 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
