Write (define) a public static method named countGreaterThan, that takes an array of int, and an int as arguments and returns (as an int) a count of the number of values in the argument array that are greater than the second argument value. For example, given the following Array declaration and instantiation: int[] myArray = {1, 22, 333, 400, 5005, 9}; countGreaterThan(myArray, 200) should return 3 countGreaterThan(myArray, 9999) should return 0 You may wish to write some additional code to test your method. ------------------------------------------- public class Main { public static void main(String[] args) { // you may wish to write some code in this main method // to test your method. } // define your method(s) here below }
Write (define) a public static method named countGreaterThan, that takes an array of int, and an int as arguments and returns (as an int) a count of the number of values in the argument array that are greater than the second argument value.
For example, given the following Array declaration and instantiation:
int[] myArray = {1, 22, 333, 400, 5005, 9};
countGreaterThan(myArray, 200) should return 3
countGreaterThan(myArray, 9999) should return 0
You may wish to write some additional code to test your method.
-------------------------------------------
public class Main {
public static void main(String[] args) {
// you may wish to write some code in this main method
// to test your method.
}
// define your method(s) here below
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images