Write Program Count Total Numbers Even Odd Elements Array Ask User Enter Array Size Fill R Q37279336

write a program to count total numbers of even and odd elementsin an array. Ask the user to enter the array size. Fill it withrandom numbers 0-99. Write method isEven(int n) that returns trueif n is even, false otherwise. Use the isEven(int n) method todetermine if an array element is even.

Example:

Enter size of the array( 1-100); 10

Random array: 7 2 3 8 6 6 75 38 3 2

Number of events= 6

Number of odd = 4


Answer


import java.util.Random;import java.util.Scanner;public class RandomOddEven { public static boolean isEven(int n) { return n

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.