Question: I need help with this c sharp programming assignment. Here is the code below I have to use to fill in the missing code and

I need help with this c sharp programming assignment. Here is the code below I have to use to fill in the missing code and modify it.

Here is the code:

using System; using System.IO; using LibUtil;

namespace ArrayProcessing { class ArrayProcessing {

const string INPUT_FILE_NAME = "...\\...\\MatrixDat.Txt"; const string OUTPUT_FILE_NAME = "...\\...\\MatrixRpt.Txt";

static int numOfRows, numOfCols; static string matrixLabel; static int[,] matrix; static StreamReader fileIn; static StreamWriter fileOut;

static void Main() { OpenFiles(); GenReport(); CloseFiles(); }

static void OpenFiles() { try { fileIn = File.OpenText(INPUT_FILE_NAME); Console.WriteLine("{0} was opened", INPUT_FILE_NAME); } catch { Console.WriteLine("Error: {0} does not exist ", INPUT_FILE_NAME); ConsoleApp.Exit(); } try { fileOut = File.CreateText(OUTPUT_FILE_NAME); Console.WriteLine("{0} was created ", OUTPUT_FILE_NAME); } catch { Console.WriteLine("Error: {0} could not be created ", OUTPUT_FILE_NAME); ConsoleApp.Exit(); } }

static void GenReport() { int i, row, col, numOfMatrices, indent;

// Fill in missing code

fileOut.WriteLine("Date: {0:MM/dd/yyyy}", DateTime.Now); fileOut.WriteLine(); numOfMatrices = Int32.Parse(fileIn.ReadLine()); for (i = 1; i // Fill in missing code } }

static void InputMatrix() { int row, col; string[] words;

matrixLabel = fileIn.ReadLine(); words = StringMethods.SpaceDelimit(fileIn.ReadLine()).Split(' '); numOfRows = Int32.Parse(words[0]); numOfCols = Int32.Parse(words[1]); matrix = new int[numOfRows + 1, numOfCols + 1]; for (row = 1; row

static int RowSum(int row) { int col, rowSum = 0;

for (col = 1; col

static int ColSum(int col) { int row, colSum = 0;

for (row = 0; row

printf(row + 1, sum); }

return colSum; } return colSum; }

static int MatrixSum() { int row, col; int matrixSum = 0;

// Fill in missing code return matrixSum; }

static void CloseFiles() { fileIn.Close(); fileOut.Close(); } } // End application class } // End namespace

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

here is the matrix data file i must use:

3 Matrix One 5 7 45 38 5 56 18 34 4 87 56 23 41 75 87 97 45 97 86 7 6 8 85 67 6 79 65 41 37 4 7 76 57 68 8 78 2 Matrix Two 6 8 45 38 5 56 18 34 4 30 87 56 23 41 75 87 97 49 45 97 86 7 6 8 85 77 67 6 79 65 41 37 4 53 7 76 57 68 8 78 2 14 21 18 46 99 17 3 11 73 Matrix Three 6 6 45 38 5 56 18 34 87 56 23 41 75 87 45 97 86 7 6 8 67 6 79 65 41 37 7 76 57 68 8 78 21 18 46 99 17 3

output specifications needs to look somewhat like this:

I need help with this c sharp programming assignment. Here is the

Fill in missing code from Array Processing Assignment project to complete a C# program that will input the definition of a sequence of matrices from a file named MatrixDat.Txt. For each matrix, calculate and display the sum of the elements in each row and each column, as well as the entire matrix. A sample report is displayed below. The report should be written to a file named MatrixRpt.Txt. Class: Purpose: Programmer: Date: Progamming Generate Matrix Row and Column Sums Programmer 1 01/27/2018 Matrix One (5 x 7) ******* * + # 45 87 45 67 7 38 56 97 6 76 5 23 86 79 57 56 41 7 65 68 18 75 6 41 8 34 87 8 37 78 4 * 200 * 97 * 466 * 85 * 334 * 4 * 299 * 2 * 296 * *** 192 * 1595 * *** *** 251 273 250 237 148 244 ***** Matrix Two (6 x 8) ****** ******** 45 87 45 67 7 21 ***** 38 56 97 6 76 18 5 23 86 79 57 46 56 41 7 65 68 99 411 * 18 75 6 41 8 17 34 87 8 37 78 3 4 97 85 4 2 11 30 * 230 * 49 * 515 77 * 53 * 352 * 14 * 310 * 73 * 288 * ******** 296 * 2106 * ******** 272 291 296 336 165 247 203 Matrix Three (6 x 6) 196 * * * 45 87 45 67 7 21 38 56 97 6 76 18 5 23 86 79 57 46 56 41 7 65 68 99 18 75 6 41 8 17 34 * 87 * 8 * 37 * 78 * 3 * 369 249 * 295 * 294 * 204 * * 272 291 ******* 296 336 165 247 * 1607 * ******* Fill in missing code from Array Processing Assignment project to complete a C# program that will input the definition of a sequence of matrices from a file named MatrixDat.Txt. For each matrix, calculate and display the sum of the elements in each row and each column, as well as the entire matrix. A sample report is displayed below. The report should be written to a file named MatrixRpt.Txt. Class: Purpose: Programmer: Date: Progamming Generate Matrix Row and Column Sums Programmer 1 01/27/2018 Matrix One (5 x 7) ******* * + # 45 87 45 67 7 38 56 97 6 76 5 23 86 79 57 56 41 7 65 68 18 75 6 41 8 34 87 8 37 78 4 * 200 * 97 * 466 * 85 * 334 * 4 * 299 * 2 * 296 * *** 192 * 1595 * *** *** 251 273 250 237 148 244 ***** Matrix Two (6 x 8) ****** ******** 45 87 45 67 7 21 ***** 38 56 97 6 76 18 5 23 86 79 57 46 56 41 7 65 68 99 411 * 18 75 6 41 8 17 34 87 8 37 78 3 4 97 85 4 2 11 30 * 230 * 49 * 515 77 * 53 * 352 * 14 * 310 * 73 * 288 * ******** 296 * 2106 * ******** 272 291 296 336 165 247 203 Matrix Three (6 x 6) 196 * * * 45 87 45 67 7 21 38 56 97 6 76 18 5 23 86 79 57 46 56 41 7 65 68 99 18 75 6 41 8 17 34 * 87 * 8 * 37 * 78 * 3 * 369 249 * 295 * 294 * 204 * * 272 291 ******* 296 336 165 247 * 1607 * *******

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!