The element is greater than or equal to min and less than


Question: These are two connected problems. If you could add some sort of explanation or work, it's a plus. Thanks!

Part 1: Complete the below method named countOutOfRange that counts and returns the number of elements of a given integer array that are "out of range" i.e. the number of elements greater than the given maximum value OR less than the given maximum value.

public static __________ countOutOfRange(int [ ] data, int min, int max) {

Part 2: Complete the method below named copyInRange which takes 3 arguments: an integer array A, an integer lower bound: min, and an integer upper bound: max. This method allocates memory for a new (potentially smaller) array and then copies elements from array A to the new array if the element is "in range" i.e. the element is greater than or equal to min AND less than or equal to max. The method should return the new array.

 You may use the countOutOfRange method from Part 1.

Example: if A = {3, 0, 4, 5, 9, 7, 2}, min = 2 and max = 7, then the returned array should be {3, 4, 5, 7, 2} where 0 has not been copied to the new array because it is less than the provide min and 9 has not been copied because it is greater than the given max.

public static __________ copyInRange(_____________________) {

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: The element is greater than or equal to min and less than
Reference No:- TGS0964681

Expected delivery within 24 Hours