Question
I am working on a matrix problem which i needed some help figuring out what i am doing wrong to get it to work using
I am working on a matrix problem which i needed some help figuring out what i am doing wrong to get it to work using C# windows form application.
The textboxes for buttons Make Matrix for A and B must be validated as an Int32 during the Leave event (Hint: try to convert the text property into an Int32 and use Try-Catch). The user should not be able to leave the TextBox until a valid integer is entered. The initial value of the Text property for all Rows and Cols should be set to 3 and the cursor should be placed in the Matrix A Rows Textbox when the form loads. Set a reasonable tab order to start at the Rows TextBox for Matrix A and tab through the components to allow efficient entry of data and execution of operations for the application
A method should be called to create a 3 x 3 A matrix with random doubles
Another method should be called to convert the matrix to a string and copy it to the textbox
This should be the same for Make Matrix B. Make a single method to create the matrix for both A and B and another method to copy the matrices to the Textboxes. Try to eliminate redundant code. To get a random double declare a random object
The Make B Identity should convert the B matrix to the identity matrix only if the number of rows and columns are equal and copy it to the Matrix B TextBox. See the form below. Note all but the diagonal elements in B are zero and the diagonal elements are 1.
The A and B matrix are not null
For multiplication, the rows of A match the columns of B and the columns of A match the rows of B
For addition and subtraction the A and B matrices should have the same dimensions.
When calculate is clicked, the C matrix should be created with the proper dimensions to contain the result of the operation given the sizes of A and B. After selecting Multiply and clicking Calculate, the form should have the result in the Matrix C TextBox as shown below.
Matrix Ops Matrix A Matrix B 2.4 0.1 5.9 1.0 0.0 0.0 0.0 1.0 0.0 6.3 2.3 7.2 1.2 0.7 1.5 0.0 0.0 1.0 Rows Cols Make Matrix A Make Matrix B Select Operation o Multiply O Add O Subtract Calculate Matrix C 2.4 0.1 5.9 6.3 2.3 7.2 1.2 0.7 1.5 Make B Identity Clear Matrices Matrix Ops Matrix A Matrix B 2.4 0.1 5.9 1.0 0.0 0.0 0.0 1.0 0.0 6.3 2.3 7.2 1.2 0.7 1.5 0.0 0.0 1.0 Rows Cols Make Matrix A Make Matrix B Select Operation o Multiply O Add O Subtract Calculate Matrix C 2.4 0.1 5.9 6.3 2.3 7.2 1.2 0.7 1.5 Make B Identity Clear MatricesStep 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