Question: Instructions: Write a complete Java program that meets the following requirements: Main Method: Initialize a 2 D ArrayList of integers with the following values: {

Instructions:
Write a complete Java program that meets the following requirements:
Main Method:
Initialize a 2D ArrayList of integers with the following values:
{{1,1,3,1,5},{1,1,3,1,5},{1,1,3,1,5},{1,1,3,1,5},{1,1,3,1,5}}
Name this 2D ArrayList Data1.
Initialize a 2D ArrayList of integers with the following values:
{{1,2,3,4,5,6,7,8,9,10},{-2,-1,2,1},{},{2,2,2}}
Name this 2D ArrayList Data2.
Run a method named SearchEven. Pass Data1 as an argument to the SearchEven method. SearchEven will return a 1D ArrayList. This ArrayList will contain the rows and columns of where each even number in the 2D parameter is located. If the 2D ArrayList contains no even numbers, the ArrayList returned will only contain the value -1.
Use a separate method to display the contents of the ArrayList that SearchEven returns. If Data1 contained at least 1 even number, then output one row and 1 column per line. If Data1 did not contain any even numbers, then display a message that indicates this. Name this method: Display_Locations.
Run the method SearchEven again. Pass Data2 as an argument to the SearchEven method.
Use the Display_Locations method to display the contents of the ArrayList that SearchEven returns. If Data2 did not contain any even numbers, then display a message that indicates this.
Sample RunNotes:
This program needs to work with 2D ArrayLists of integers of any size.
The 2D ArrayLists can have any (non-negative) number of rows.
Each row can have any (non-negative) number of elements.
Making an algorithm before attempting to code this program will be helpful to you.
 Instructions: Write a complete Java program that meets the following requirements:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!