Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ matrix calculator 1 PLEASE READ ALL THE QUESTION CAREFULLY AND DO EXACTLY AS IT ASKS. ANYTHING ELSE WONT BE ACCEPTED. It is required to
C++ matrix calculator 1 PLEASE READ ALL THE QUESTION CAREFULLY AND DO EXACTLY AS IT ASKS. ANYTHING ELSE WONT BE ACCEPTED. 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 USER SHOULD WRITE THE MATRIX IN A STRING FORMAT) The matrix should be entered by the user in the following format: [1 2 5, -1 8 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 NOTE: THE USER WILL DECIDE THE SIZE OF THE MATRIX IT DOESN'T HAVE TO BE 3x3. 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 output 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 written as follows (-0.1 25,-18 14.2, 7.01-18 99.3, 15.0-99.24 18] User will input the matrix of size nxm; where O<>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started