Please written by computer source const int ROW_SIZE = 10; const int COLUMN_SIZE = 10; int myMatrix[ROW_SIZE][COLUMN_SIZE]; Note that these constants will be in main and not in the scope of any other function. That is, you must design your functions to have parameters to receive the dimensions. Write a function called initialize that receives a 2D array and initializes the array with random values between 0 and 99. Add a message that confirms the successful creation of the matrix. Call this function in main to initialize myMatrix. Write a function called display that receives a 2D array and displays the elements of the array in a tabular format. Arrange the method to display row and column numbers. Row indices displayed on the left and column indices displayed at the top. Call this function in main to print myMatrix. Write a function called sumEven that receives a 2D array and returns the sum of all the even elements. Call this function in main to calculate and display this value for myMatrix. Write a function called sum2Diagonal that receives a 2D array and sums all the values in the secondary diagonal (Top right to bottom left). Call this function in main to calculate this value for myMatrix. Write a function called sumColumn that receives a 2D array and a column number. The function returns the sum of all the elements in that column. Call this function in main to calculate and display this value for the last column of myMatrix. Write a function called largestSum that receives a 2D array and returns the number of the row with the largest sum of elements. Call this function in main to calculate and display this value for myMatrix.  Write a function called transpose that receives a 2D array and transposes the array. The transposed matrix will be stored in another 2D array. For comparison print both matrices. Call this function in main to transpose myMatrix.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Please written by computer source

const int ROW_SIZE = 10; const int COLUMN_SIZE = 10; int myMatrix[ROW_SIZE][COLUMN_SIZE];

Note that these constants will be in main and not in the scope of any other function. That is, you must design your functions to have parameters to receive the dimensions.

Write a function called initialize that receives a 2D array and initializes the array with random values between 0 and 99. Add a message that confirms the successful creation of the matrix. Call this function in main to initialize myMatrix.

Write a function called display that receives a 2D array and displays the elements of the array in a tabular format. Arrange the method to display row and column numbers. Row indices displayed on the left and column indices displayed at the top. Call this function in main to print myMatrix.

Write a function called sumEven that receives a 2D array and returns the sum of all the even elements. Call this function in main to calculate and display this value for myMatrix.

Write a function called sum2Diagonal that receives a 2D array and sums all the values in the secondary diagonal (Top right to bottom left). Call this function in main to calculate this value for myMatrix.

Write a function called sumColumn that receives a 2D array and a column number. The function returns the sum of all the elements in that column. Call this function in main to calculate and display this value for the last column of myMatrix.

Write a function called largestSum that receives a 2D array and returns the number of the row with the largest sum of elements. Call this function in main to calculate and display this value for myMatrix.

 Write a function called transpose that receives a 2D array and transposes the array. The transposed matrix will be stored in another 2D array. For comparison print both matrices. Call this function in main to transpose myMatrix.

Expert Solution
steps

Step by step

Solved in 3 steps with 7 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT