Question: You do not need to code a method. Code a repetition control structure that processes an array of integers to count how many even and
You do not need to code a method.
Code a repetition control structure that processes an array of integers to count how many even and odd integers the array contains. Processing should cease when either a negative integer or the end of the array is encountered. The array can be any length and can be empty.
Declare all required variables and give them initial values if required.
If the array is not empty display the number of odd and even integers in the array, formatted informatively, using System.out.println(...) otherwise display a suitable message.
Step by Step Solution
There are 3 Steps involved in it
To achieve this task you can use a simple loop to iterate through the array of integers count the nu... View full answer
Get step-by-step solutions from verified subject matter experts
