Problem 1 Implement a method named initialize(). The method takes a two-dimensional square array of integers named arr, as a parameter. It initializes all of the elements of the array to the sum of their indices except for the major diagonal (upper left to lower right), where each element is initialized to -1. (For testing, use a 4X4 array and have the application print out the array in 2-dimension format.)
Problem 3 Implement a recursive method printDigits() that takes an integer num as a parameter and prints its digits, one digit per line.
For example, the output for the method call printDigits(23145) would display
2
3
1
4
5
Problem 4 Implement a recursive method sumArray() that returns the sum of the first few numbers in the array. The method takes two parameters:
a non-empty integer array, numArray
numbersToAdd, a positive integer representing the number of entries in array to add.
You may assume valid parameters. For example,
int[] a ={1,3,2,5};
System.out.println(sumArray(a,3)); //will display 6
System.out.println(sumArray(a,4)); //will display 11
Problem 5 Test all methods above in a program, TestArraysAndRecursion, by using examples and/or instructions given in each problem.