COSC 311 Homework 9/6/2018 Create a new array of ints by repeating an input array of ints a specified number of times. Distributed: R 9/6/2018 Due: T 9/11/2018 Write a Java function that will return an array of ints that is formed by repeating an input array a specified number of times. This is not a destructive function: allocate space for the resulting array. The input array is not modified. The function header is: int[] repeat (int[] a, int factor); You may use static function for repeat() if you prefer. You will need a print array function as well. You may use the following code or your own code. printArray(int[] array) { for (int i = 0; i < array.length; i++) System.out.print(" " + array[i] + " "); System.out.println(); } Example: int[] a = {1, 2, 3, 4}; int[] b = repeat(a, 2); The array b is {1, 2, 3, 4, 1, 2, 3, 4} Repeat size <= 0 returns an empty array (size 0). To demonstrate your program works, for each call to repeat(), - call repeat(a,factor) - print a[], factor, b[] Execute the following cases: (1) a = {1, 2, 3} factor = 1 repeat(a, factor) --> {1, 2, 3} (2) a = {1, 2, 3} factor = 2 repeat(a, factor) --> {1, 2, 3, 1, 2, 3} (3) a = {1, 2, 3} factor = -2 repeat(a, factor) --> {} Constraints: (1) Use no Java objects or classes beyond char stream I/O; do not use ArrayList (2) You must use int[] arrays. (3) Allocate space for the resulting array BEFORE you start to fill it. (4) No comments outside of the header -- this code should be self-documenting. Points taken off for: (1) Doesn't work (2) Failure to meet style constraints (3) Code does not match output (4) Ugly or difficult to understand code Turn in: -- Hard copy of code -- Header must include your last name, homework identifier (hw0906), URL of source code. -- Screen shot showing program execution on the three cases (values given above).