Answer:
Here is the additional method you need to write:
<em> public static int [] newArrayNumbers (int [] numbers){</em>
<em> int [] newArray = new int[10];</em>
<em> for (int i=0; i<numbers.length; i++){</em>
<em> newArray[i]=numbers[i];</em>
<em> }</em>
<em> newArray[9]=10;</em>
<em> return newArray;</em>
<em> }</em>
The complete code is given in the explanation section
Explanation:
<em>import java.util.Arrays;</em>
<em>public class NewQues{</em>
<em>public static void main(String[] args) {</em>
<em> int [] numbers = {99,56,103,9,31,63,81,92,13};</em>
<em> int m = maximum (numbers);</em>
<em> int n = minimum (numbers);</em>
<em> System.out.println("max ="+ m);</em>
<em> System.out.println("min ="+ n);</em>
<em> System.out.println(Arrays.toString(newArrayNumbers(numbers)));</em>
<em> }</em>
<em>public static int maximum (int [] numbers){</em>
<em> int i=0;</em>
<em> int max;</em>
<em> max = numbers[i];</em>
<em />
<em> for (i = 1; i < numbers.length; i++){</em>
<em> if (numbers[i]> max)</em>
<em> {</em>
<em> max = numbers[i];</em>
<em> }</em>
<em> }</em>
<em> return(max);</em>
<em> }</em>
<em>public static int minimum (int [] numbers){</em>
<em> int i=0;</em>
<em> int min;</em>
<em> min = numbers[i];</em>
<em> for (i = 1; i < numbers.length; i++){</em>
<em> if (numbers[i]< min)</em>
<em> {</em>
<em> min = numbers[i];</em>
<em> }</em>
<em> }</em>
<em> return(min);</em>
<em> }</em>
<em> public static int [] newArrayNumbers (int [] numbers){</em>
<em> int [] newArray = new int[10];</em>
<em> for (int i=0; i<numbers.length; i++){</em>
<em> newArray[i]=numbers[i];</em>
<em> }</em>
<em> newArray[9]=10;</em>
<em> return newArray;</em>
<em> }</em>
<em> }</em>
This for statement here does the work for you. assigning the values in the first array to the second array. <em> </em>
<em>for (int i=0; i<numbers.length; i++){</em>
<em> newArray[i]=numbers[i];</em>
<em> }</em>
The second logic is, since you knew the first array had 9 elements, you create the second to have 10 elements so you can assign the element at the last index (9) the value of ten as required by the question