/* CSC 16 Lab 3 : Random map generation with 2D arrays Due Tuesday 9/27 (please observe due date) The week's lab will introduce you to the use of multi-dimensional arrays. A 2D array of doubles, for example, is created as follows: double[][] A; A = new double[4][5]; The array consists of 4 rows and 5 columns. Arrays in Java (as well as C++) are stored "row-major" order, which means that the row number or y-coordinate comes before the column number or x-coordinate. Please visualize the coordinates in the correct orientation. An array variable such as A above is a pointer to a structure stored on the heap. One can also think of a 2D array as a one-dimensional array with elements that are also (pointers to) one-dimensional arrays. It is perfectly valid to treat a 2D array this way. For example, the expression A.length will return 4, the length of the "outer" array. A[0].length will give 5, which is the length of the "inner" array. Operations on 2D arrays usually will involve a nested loop, which enumerates through each coordinate of the array. The following code sets the value of every element of an array to 1: int rows = A.length; int cols = A[0].length; for(int i=0;i0. Similarly, you cannot refer to map[i+1][j] without first checking that i