Can the rows in a two-dimensional array have different lengths?
A two-dimensional array can have rows of different lengths. This kind of two-dimensional array is known as ragged array.
Write a method that sums all the numbers in the major diagonal in an matrix of double values using the following header:
public static double sumMajorDiagonal(double m)
Write a test program that reads a 4-by-4 matrix and displays the sum of all its elements on the major diagonal. Here is a sample run:
Enter a 4-by-4 matrix row by row: 1 2 3 4.0 <enter> 5 6.5 7 8 <enter> 9 10 11 12 <enter> 13 14 15 16 <enter> Sum of the elements in the major diagonal is 34.5