Question: Lab Description Write a program that will search a list to find the first odd number. If an odd number is found, then find the



Lab Description Write a program that will search a list to find the first odd number. If an odd number is found, then find the first even number following the odd number. Return the distance between the first odd number and the LAST even number. Return -1 if no odd numbers are found or there are no even numbers following an odd number. Sample Data [7,1,5,3,11,5,6,7,8,9,10,12345,11] [11,9,8,7,6,5,4,3,2,1,-99,7] 10,20,30,40,5,41,31,20,11,71 [32767,70,4,5,6,7] [2,7,11 ,21,5,7] [7,255,11,255,100,3,21 [9,11,11,11,7,1000,3] [7,7,7,11,2,7,7,11,11,2] [2,4,6,8,81 Files Needed: OddToEvenRunner. java ListoddToEven.java Sample Output 10 6 import java.util.ArrayList; import java.util.List; public class ListOddToEven public static boolean go( List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
