Project #41028 - Java homework

 Matrix Addition

 

Write a program that can create two matrices and then adds them!

  • The user first inputs the size length and width
  • The user then inputs the size length and width of the next matrix
  • Next the user populates that matrices with data
  • The program must check to see if the dimensions match.  Matrix addition requires the size of both to be the same.  If they are not then print “Cannot add these!  Dimension mismatch”           
  • If they do match correctly then create a new matrix and put the newly added info inside of it.
    • Add each component wise, so A[1][1] + B[1][1] = C[1][1]

 

 

Welcome to the matrix adder program

 

Please enter the length of the first matrix

2

Please enter the height of the first matrix

2

Please enter the length of the second matrix

2

Please enter the height of the second matrix

2

 

Please enter a value for matrix 1 space 1, 1

4

Please enter a value for matrix 1 space 1, 2

1

Please enter a value for matrix 1 space 2, 1

8

Please enter a value for matrix 1 space 2, 2

7

 

Please enter a value for matrix 2 space 1, 1

1

Please enter a value for matrix 2 space 1, 2

3

Please enter a value for matrix 2 space 2, 1

2

Please enter a value for matrix 2 space 2, 2

4

 

 

4 1

8 7

+

1 3

2 4

=

5 4

10 11

DONE!

Subject Computer
Due By (Pacific Time) 09/23/2014 11:30 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy