Home /
Expert Answers /
Computer Science /
write-a-static-method-countevens-that-has-four-integer-parameters-and-returns-the-count-of-parame-pa369
(Solved): Write a static method countEvens() that has four integer
parameters, and returns the count of parame ...
Write a static method countEvens() that has four integer
parameters, and returns the count of parameters where the value is
an even number (i.e. evenly divisible by 2).
Write a static method countEvens0 that has four integer parameters, and returns the count of parameters where the value is an even number (i.e. evenly divisible by 2 ). Ex: If the four parameters are: 1221140 then the returned count will be: 2 Hint: Use the modulo operator \% to determine if each number is even or odd. Your program must define the method: public static int countEvens(int num1, int num2, int num3, int num4)
11.16.1: Count evens - CTP 115 LabProgram.java Load default template...
ANSWER : JAVA CODE : import java. util. Scanner; public class Main { /* Type your code here */ public static int countEvens(int num1 , int num2 , int num3 , int num4)