Question: Program the following program using Java. Question 6 (Bonus)-5 points Write a function count_even after_odd (int] array) that: Takes as input an array of integers.
Program the following program using Java.
Question 6 (Bonus)-5 points Write a function count_even after_odd (int] array) that: Takes as input an array of integers. The function returns the number of even integers in the array that immediately follow an odd integer. For example: eIfal 1, 5, 4, 5, 4, 2, 3, 6), then count_even_after_odd (al) returns 3, because there are two 4's that come immediately after a 5, and one 6 that comes immediately after a 3. If al 120, 10, 3, 10, 5, 2, 2, 4), then count_even_after_odd (al) returns 2, because there is one 10 that come immediately after a 3, and one 2 that comes immediately after a 5. Ifal(20, 10, 3, 5), then count_even_after_odd (al) returns 0, because there is no even number coming immediately after an odd number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
