[Methods to be implemented]
Method: fillArray
the method accepts a non-null
String variable as an argument. Return a char array that has been filled from the String passed to the method, each element set to the corresponding character in the string. public char[] fillArray(String var)
Method: stringArray
the method accepts an array of chars as an argument if the chArray is null or length is zero, returns an empty string if chArray is not null, return a single string with each of the characters in the array in the string. public String stringArray(Char[] chArray)
Method: productMatrix 0 <= n <= 100 if n is out of bounds, return null if n is greater than or equal to zero, return a n x n matrix with each element of the matrix set to row index * column index. public int [] [] productMatrix(int n)
Method: sumOfSquares the method accepts an array of ints if the array is null or of size zero, return 0 if the size of the array is greater than or equal to 1 return an int equal to the sum of the square of each element of the array public long sumOfSquares(int[] intArray)
Method: incPosArray the method accepts an array of ints if the array is null or of size zero, simply return if the size of the array is greater than or equal to 1 increment each positive element of the array, leaving the negative elements and the elements equal to zero set to their incoming values public void incPosArray(int[] intArray)
public class Q3 {
/*
* Method: fillArray
*/
public char[] fillArray(String var){
System.out.println( "fillArray not implemented");
return null;
}
/*
* Method: stringArray
*/
public String stringArray(char[] chArray) {
System.out.println( "stringArray not implemented");
return null;
}
/*
* Method: productMatrix
*/
public int[][] productMatrix(int n){
System.out.println( "productMatrix not implemented");
return null;
}
/*
* Method: sumOfSquares
*/
public long sumOfSquares (int[] intArray) {
System.out.println( "sumOfSquares not implemented");
return -1;
}
/*
* Method: incPosArray
*/
public void incPosArray (int[] intArray) {
System.out.println( "incPosArray not implemented");
return;
}
public static void main (String[] args) {
Q3 q3 = new Q3();
//Put your
test code here
}
}