Question: User Interface (30 pts) Write a program called MatrixProcessor.java. In this program, your task is to read the file matrixA.txt, located at the website. Once

User Interface (30 pts) Write a program called MatrixProcessor.java. In this program, your task is to read the file matrixA.txt, located at the website. Once you read the file, create and populate a two dimensional array with the information in the file. Notice that the first line of the file corresponds to the actual dimensions of the array (i.e., rows and columns), the rest of the lines in the file corresponds to the actual data that must be stored in the array. Methods (70 pts) In the same program, implement the following methods defined belog. Your program must test all the methods and write into a file the answers for each method invoked. For illustration purposes in dierent methods, consider the following matrix as an example: A = 2 6 6 6 6 4 12345 34567 37161 74432 87661 3 7 7 7 7 5 1. getRowTotal: takes two arguments: a 2D array that contains ints, and an int r representing the row for the array, which it is desired to find the total of that row. 2. getColTotal: takes two arguments: a 2D array that contains ints, and an int c representing the col for the array, which it is desired to find the total of that column. 3. getSum: will take the 2D array of ints and will return the sum of all the indexes of the array. 4. getAVG: will take the 2D array of ints and will return the average of the array provided. Page 1 of 2 Lab # 2 Section: COSC 1437 5. getDiagonalsProduct: will take the 2D array of ints and will return a vector containing two values: the product of the left diagonal, the product of the right diagonal, and the product of both diagonals of the matrix. E.g., in the matrix A, the result will be a vector {12, 960, 11520}, since the left diagonal is composed of: {1, 4, 1, 3, 1}, the product is 12, and the right diagonal is {5, 6, 1, 4, 8} the product is 960. The product of left and right diagonal is 11,520. 6. getLargestVector: will take the 2D array of ints and will return a vector containing the product of the largest value per row times the largest value per column. E.g., in the matrix A, the resulting vector will be extracted from the set of values: { {40, 56, 56, 56, 64}, {35, 49, 49, 49, 56}, {30, 42, 42, 42, 48}, {30, 42, 42, 42, 48}, {35, 49, 49, 49, 56}} resulting on: {64, 56, 48, 48, 56}. 7. getSmallesttVector: will take the 2D array of ints and will return a vector containing the product of the smallest value per row times the smallest value per column. E.g., in the matrix A, the resulting vector will be extracted from the set of values: {1, 3, 1, 2, 1}, {2, 6, 2, 4, 2}, {1, 3, 1, 2, 1}, {3, 9, 3, 6, 3}, {1, 3, 1, 2, 1} resulting on: {1, 2, 1, 3, 1}.

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!