Question: Please write in Java. thank you. Multidimensional Array: Matrix Processor Lab DESCRIPTION The purpose of this assignment is to demonstrate the programming skills related with

 Please write in Java. thank you. Multidimensional Array: Matrix Processor Lab

DESCRIPTION The purpose of this assignment is to demonstrate the programming skills

Please write in Java. thank you.

Multidimensional Array: Matrix Processor Lab DESCRIPTION The purpose of this assignment is to demonstrate the programming skills related with file reading and data processing. Using the data from a file, populate a two dimensional array, then perform operations with the data already stored in a two dimensional array. PART I: INTERFACE (40 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. For each line in the file, it corresponds to a row in the matrix. Each row contains several columns separated by a "blank space. For Example, consider the file matrixA.txt matrixA.txt OOO 43 13 9 68 224 -1 1 6 4 18 2 19 7 The first line of the file corresponds to the information about the matrix. The 4 corresponds to the number of rows, the 3 corresponds to the number of columns. The next line: 13 9 68 corresponds to the first row, the 224 -1 1 to the second row, the 6 4 18 to the third, and 2 19 7 to the fourth row. Notice that the first line on the file is critical in order to create the matrix. Your program shall check if the dimensions represent positive numbers, i.e., greater than 0. In case the number of rows or columns are not positive values, your program shall throw a InvalidMatrixFormatException. You are responsible to create these exceptions. Test your program including the methods from Part II in order to get total points. PART II: METHODS (60 PTS) Implement the following methods in MatrixProcessor.java every method shall have its own javadoc to get full credit. Test each of the methods with the matrix obtained from Part I. 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 5. getLargestRowVector: will take the 2D array of ints and will return a vector a one-dimensional array) where each index represent the largest value per row. E.g., consider matrix A, the resulting vector after calling the method will be {68, 224, 18, 18). 6. getLargest collector: will take the 2D array of ints and will return a vector (a one-dimensional array) where each index represent the largest value per column. E.g., consider matrix A, the resulting vector after calling the method will be {224, 19, 68). You can assume the given file will contain non-ragged arrays. SUBMISSION Submit your code (MatrixProcessor.java and possible Exception files) via Blackboard Attach any files used in the program, including the text file

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!