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
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