Question: please help in java Write a program that displays 4 matrices to the user, then asks the user to select 2 matrices. Then ask if

please help in java

Write a program that displays 4 matrices to the user, then asks the user to select 2 matrices. Then ask if they want to add or multiply them. Print out the two matrices the user selected along with the results of the users choice (if possible).

Program Requirements:

Create 4 matrices: a 2x2, a 2x3, a 3x2, and a 3x3 matrix. Hard code the values in each of the matrices. Do NOT ask the user for the values in each matrix.

For example:

A = 1 1

2 3

B = 4 5 1

5 6 12

C = 6 -1

7 -9

2 0

D = 9 5 3

-1 0 5

12 0 7

Select the first matrix (A,B,C,D): a

Select the second matrix (A,B,C,D): c

Do you want to add or multiply them (A, M): m

Invalid. You cannot multiply A and C together.

  • The user can choose the same matrix twice.
  • Do no use binary (1,0 only) matrices.
  • Do not hard code the ANSWERS (just the matrices).
  • Provide some test cases. (Refer to Developing Test Cases in the Getting Started module for my expectations on test cases)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!