Question: Output: Write a program that asks the user for the number of columns in a square matrix (2-d array with the same number of
Output: Write a program that asks the user for the number of columns in a square matrix (2-d array with the same number of rows and columns). Randomly fill the matrix with int values between 1 and 1000. Write methods to calculate the following: The average of all values in the matrix The sum of all values in the matrix The largest value in the matrix The smallest value in the matrix The value that occurs the most frequently in the matrix Display the matrix and the results of all methods Enter the number of columns in a square matrix: 5 167 489 286 489 510 638 247 3 321 217 158 949 61 533 858 730 896 78 830 690 907 52 568 543 151 The average of all values in the matrix is: 454 The sum of all values in the matrix is: 11371 The largest value in the matrix is: 949 The smallest value in the matrix is: 3 The mean value in the matrix is: 489
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
