2DArray method:It will allocate a block of memory which represents a two-dimension array based on the input values supplied by the user. Ask the user to enter the number of rows and column for 2D array that the user want to manipulate. The number of rows and columns that the user enters may or may not define a square matrix (when the number of rows equals the number of columns). The array will have exactly rows time columns (m * n) elements. It will not contain any extra or empty cells. Initialize the “matrix” by rows with random number between 1 to 100. Pass two arguments by out reference so that you can assign the number of row and columns of data to the first and second arguments. This is return 2D array method after allocating new memory for 2D array and initialize it with random value. Generate random number code in C# as following: Random randnum = new Random( ); int number = randnum.Next (1, 101); SwapRow method: it will rotate the data in the matrix in an up/down method such that the first row is exchanged with last row (swap row 0 and row m-1, swap row 1 and row m-2, etc.). SwapColumn method: it will rotate the data in the matrix in a left/right method such that the first column is exchanged with the last column (swap column 0 and column n-1, swap column1 and column n-2, etc.) RotateLeftDiagonal method: it will rotate the data in the matrix by the left diagonal. This operation is usually referred to as a matrix transpose. This is done by exchanging element [i, j] with element [j, i]. The values on the left diagonal do not move for a square matrix. Do not forget to swap the values for the number of rows and columns. Pass these two arguments by reference so that you can change their values. RotateRightDiagonal method: it will rotate the data in the matrix by the right diagonal. This operation will require that you exchange element [0, 0] with element [m-1, n-1]. The values on the right diagonal do not move for a square matrix. Do not forget to swap the values of the number of rows and columns. Pass these two arguments by reference so that you can change their values. DisplayArray method: it will print the array in a two-dimension format with rows and columns as you would normally print a compile time defined two-dimension array. Be sure that the columns are aligned correctly for display purposes. Use type integer (int) for the array. In the main, program call methods in following order: 2DArray, SwapRow, SwapColumn, RotateLeftDiagonal, RotateRightDiagonal. After each method has been called you must print the matrix, which is calling DisplayArray method, and pause the program so that the result of the operation can be viewed. After the results of the operation of 4 methods has been printed, then continue running the program until the user want to quit. Clearly label each matrix with the operation that was performed on the matrix.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

2DArray method:It will allocate a block of memory which represents a two-dimension array
based on the input values supplied by the user. Ask the user to enter the number of rows and
column for 2D array that the user want to manipulate. The number of rows and columns that the
user enters may or may not define a square matrix (when the number of rows equals the number
of columns). The array will have exactly rows time columns (m * n) elements. It will not
contain any extra or empty cells. Initialize the “matrix” by rows with random number between 1
to 100. Pass two arguments by out reference so that you can assign the number of row and
columns of data to the first and second arguments. This is return 2D array method after
allocating new memory for 2D array and initialize it with random value. Generate random
number code in C# as following: Random randnum = new Random( );
int number = randnum.Next (1, 101);
SwapRow method: it will rotate the data in the matrix in an up/down method such that the first
row is exchanged with last row (swap row 0 and row m-1, swap row 1 and row m-2, etc.).
SwapColumn method: it will rotate the data in the matrix in a left/right method such that the
first column is exchanged with the last column (swap column 0 and column n-1, swap column1
and column n-2, etc.)
RotateLeftDiagonal method: it will rotate the data in the matrix by the left diagonal. This
operation is usually referred to as a matrix transpose. This is done by exchanging element [i, j]
with element [j, i]. The values on the left diagonal do not move for a square matrix. Do not
forget to swap the values for the number of rows and columns. Pass these two arguments by
reference so that you can change their values.
RotateRightDiagonal method: it will rotate the data in the matrix by the right diagonal. This
operation will require that you exchange element [0, 0] with element [m-1, n-1]. The values on
the right diagonal do not move for a square matrix. Do not forget to swap the values of the
number of rows and columns. Pass these two arguments by reference so that you can change
their values.
DisplayArray method: it will print the array in a two-dimension format with rows and columns
as you would normally print a compile time defined two-dimension array. Be sure that the
columns are aligned correctly for display purposes.
Use type integer (int) for the array. In the main, program call methods in following order:
2DArray, SwapRow, SwapColumn, RotateLeftDiagonal, RotateRightDiagonal. After each
method has been called you must print the matrix, which is calling DisplayArray method, and
pause the program so that the result of the operation can be viewed. After the results of the
operation of 4 methods has been printed, then continue running the program until the user want
to quit. Clearly label each matrix with the operation that was performed on the matrix.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY