public class MultidimensionalArraysExercises{ /* Two-dimensional Arrays 2. Write a method that takes a two-dimensional array as a parameter (and no other parameters). Have the method populate each value in the array. Start with 0.0 in the first index, then 0.001 in the second, etc. What should the return value be? Write some code to test your method. */ /** * Simulates data with 0.000 in the first element and 0.001 in the second, etc. * @param array A rectangular or ragged array */ public static populate( array ){ } /* Two-dimensional Arrays 3a. Write a method that takes a two-dimensional array as a parameter (and no other parameters). Have the method return the total of all of the values in the array. Write some code to test your method. (If you use the method described above to populate each value in the rainfall array, then you should get a total of approximately 66.43. Note, if you're getting a total of 69.006, then you're probably using a rectangular array instead of a ragged or jagged array.) */ /** * Calculates the total of all of the values * @param array A rectangular or ragged array * @return The sum of all of the values in array */ public static total( array ){ double total = 0.0; return total; } public static void main( String[] args ){ /* Two-dimensional Arrays 1. Declare a two-dimensional array that can hold the amount of rainfall for everyday in a year. The first index should be the month and the second index the day of the month. */ System.out.println( "Last rainfall amount: " + rainfall[ ???? ][ ???? ] ); /* Two-dimensional Arrays 3b. Write some code to test your method. (If you use the method described above to populate each value in the rainfall array, then you should get a total of approximately 66.43. Note, if you're getting a total of 69.006, then you're probably using a rectangular array instead of a ragged or jagged array.) */ System.out.println( "Total rainfall: " + total ); /* Multidimensional Arrays 1. Declare a multi-dimensional array that can hold the amount of rainfall for everyday in a year for 100 years. The first index should be the year, the second index the month and the third index the day of the month. Will the methods described above work in this three- dimensional array? Discuss with someone else why or why not. */ } }