Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 ray ) return false; public class OddToEvenRunner public static void main( String args)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started