Question: 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
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
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 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 } }
how do you construct these methods? 
PUbLJL * Method: fillArray * Precondition: the method accepts a non-null String variable as an argument the string passed to the method, each element set to the corresponding character in the string Postcondition: Return a char array that has been filled from (i.e. resultt0]-the character at index 0 in the string) public char[) fillArray(String var); Precondition: the method accepts an array of chars as an argument Postcondition: if chArray is not null, return a single string *Method: stringArray * Postcondition: if chArray is nul1 or length is zero, returns an empty string with each of the characters in the array in the string. ' ! ' ) * Example: The array {'N', 'e', 'I', '1', ' "returns the string "Well done! " , , 'd', 'o', 'n, , ,e', public String stringarray (char [] charray) * Method: productMatrix * precondition : 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
