Complete the method, named countOccurs, in the class named ArrayOps.java. There are two parameters t

Complete the method, named countOccurs, in the class named ArrayOps.java. There are two parameters to this method: the first is an integer array, and the second parameter is a single integer.

This method counts the number of occurrences of the given integer (second) parameter within the array of integers. This integer count is the return value. For example, if the array contains four integers: 23, 31, 17, 23, and the second parameter is the value 23, then the value returned would be 2, as 23 occurs twice within that array. However, if the second parameter is the value 42, the value returned would be zero, as the array does not contain the integer 42.

Complete the following code: public class ArrayOps { /** This method goes through the array of integers identified by the first parameter, while counting the number of occurrences of the second parameter, a single integer, within the array. @param theArray, an array of integers @param theChar, an integer whose occurrences within the array need to be counted @ return, the count of the occurrences of the integer represented by the second parameter in the array of integers. */ public static int countOccurs(int[] theArray, int theInt) { int count = 0; // loop though theArray, counting occurrences of theInt // your work here // return count of occurrences // your work here } }

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now
 

Looking for a Similar Assignment? Let us take care of your classwork while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Use Code FREE15