Question: Write a calculator program (in JAVA) have functions: addition, subtraction, multiplication functions for matrix. Function details: Function 1: Display a menu and ask users to

Write a calculator program (in JAVA) have functions: addition, subtraction, multiplication functions for matrix.

Function details:

Function 1: Display a menu and ask users to select an option.

  • Users run the program. The program prompts users to select an option.

  • Users select an option, perform Function 2.

Function 2: Perform function based on the selected option.

  • Prompt users input number of row, number of column of 2 matrixes.

  • Prompt users input values of matrixes must be the number. If users input values that are not a number, display notification on the screen: Values of matrix must be the number.

  • Option 1: Addition matrixes

  • Display result.

  • Option 2: Subtraction matrixes

  • Display result.

  • Option 3: Multiplication matrixes

  • Display result.

  • Option 4: Exit program.

Expectation of User interface:

Guidelines

Student must implement methods

additionMatrix

subtractionMatrix

multiplicationMatrix

in startup code.

Function 1: Addition matrixes

  • Implement function: public int[][] additionMatrix (int[][] matrix1, int[][]matrix2)

  • Input:

  • matrix1: The first matrix.

  • matrix2: The second matrix.

  • Return values: The result.

Function 2: Subtraction matrixes

  • Implement function: public int[][] subtractionMatrix (int[][] matrix1, int[][]matrix2)

  • Input:

  • matrix1: The first matrix.

  • matrix2: The second matrix.

  • Return values: The result.

Function 3: Multiplication Matrixes

  • Implement function: public int[][] multiplicationMatrix(int[][] matrix1, int[][]matrix2)

  • Input:

  • matrix1: The first matrix.

  • matrix2: The second matrix.

  • Return values: The result.

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!