Question: write a program by using C# . Thanks Write a program by C# programming language that has the followings: static void Main(string[] args) try //
![by C# programming language that has the followings: static void Main(string[] args)](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39d5d869b8_56566f39d5d15c92.jpg)

Write a program by C# programming language that has the followings: static void Main(string[] args) try // Declare two integer variables named as "row" and "col" 1/ Get the values of the "row" and "col" from the user // if the value of the "row" is less than 1, catch part will be run 11 // if the value of the "col" is less than 1, catch part will be run // Declare the two dimensional integer array "matrix" // which has the size (row x col) // Create the Streamliriter object named as "sw". // "s" will reference "myfile.txt" // Call "CreateRandomNumbers" method 1/ to assign random values to each element of "matrix" array // Call "WriteToFile" method. // Create the StreamReader object named as "sr". 11 "sr will read all content of "myfile.txt" // and the content will be displayed at Console window. } catch (Exception) ) publie static void CreateRandomNumbers(int[] =) { 1/ Create random numbers for each element of the "a" array. 1/ Random values will be between 10 and 100 } public static void WriteToFile(StreamWriter w, int[] =) { // Write the elements of the "" array in the matrix format Il to the file "myfile.txt". 1/ Call the "AverageOfATIEI ements" method and 11 write the returned value after the text 11 "The average of all elements of the matrix:" in the file "myfile.txt". 11 1/ Put the header "LIST OF ODD NUMBERS IN EACH ROW=" in the file "wyFile.txt". 1/ Call the "WriteOddNumbersOfEachRow" method. 1/ Put the header "LIST OF EVEN NUMBERS IN EACH COLUMN" in the file "myfile.txt" 1/ Call the "WriteEvenNumbersOfEachColumn" method. public static double AverageOfATIElements(int[] =) { // } publie static void WriteOddNumbersOfEachRow(StreamWriter , int[] =) { // Write the odd numbers in each row of the "." array Il to the "myFile.txt" as in the output example. } public static void WriteEvenNumbersOfEachColumn(StreamWriter w, int[] ) { // Write the even numbers in each column of the "m" array Il to the "myfile.txt" as in the output example. OUTPUT EXAMPLES: 1. example 2. example C:\Windows\system32\cmd.exe C. Windows\system32\cmd.e. Enter the row number: -5 Enter the row number: 5 Enter the column number: -10 Row or column number can not be less than 1 Row or column number can not be less than 1 Press any key to continue.. Press any key to continue.. 3. example Content of "myFile.txt" Console window Windows\system32\cmd.exe Enter the row number: 5 Enter the column number: 10 MATRIX: 23 73 56 66 31 96 54 26 40 39 23 97 10 59 89 97 83 85 62 53 42 18 29 10 51 25 21 90 90 22 my Note Pie Lat Format View Help MATRIX: 23 73 56 66 31 439 54 76 10 39 2 92 59 89 97 05 53 95 29 12 18 29 18 10 50 51 2521 90 90 72 29 63 9a 22 45 21 12 91 11 13 29 63 69 33 98 77 45 81 99 29 91 36 99 The average of all elements of the matrix: 55.82 The average of all elements of the matrixt 5.02 LIST OF COO NUMBERS IN CACHROME Odd numbers in 1. row: 23 1 31 41 19 11 Odd numbers in 2. row: 292307 29 77 Odd numbers in 3. row: 59 59 55 33 63 45 9 Odd numbers in 4. row: 95 29 29 60 R1 odd numbers in 5. row! 51 25 21 33 41 99 LIST OF ODO NUMBERS IN EACH ROW: pod numbers in 1. row: 23 73 31 41 13 11 Odd numbers in 2. row: 39 2397 29 77 pod numbers in 3. row: 99 99 97 83 85 53 63 45 91 dd numbers in 4. row: 95 29 29 6981 pod numbers in S. row: 51 25 21 33 41 99 LIST OF EVEN NUPUERS IN EACH COLUMN fven numbers in 1. colunt 54 50 Even numbers in 2. columni 76 Even numbers in 2. column 56 404 Even numbers in 4. column: 06 20 Even numbers in 5. rolu Cven numbers in 6. columnt 62 40 90 Even numbers in 2. columnt 96 10 10 72 Even numbers in . column EVER numbers in 9. col98 tven numbers in 10. column 42 36 LIST OF EVEN NUMBERS IN EACH COLUN: Even numbers in 1. column: 54 50 Even numbers in 2. colum: 76 Even numbers in 3. column: 56 40 42 Even numbers in 4. column: 66 18 Even numbers in 5. column: 90 Even numbers in 6. column: 62 4890 Even numbers in 7. column: 96 10 10 22 Even numbers in 8. columns Even numbers in 9. column: 98 Even numbers in 10. column: 4236 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
