Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 D ArrayList of integers with the following values:
Name this D ArrayList Data
Initialize a D ArrayList of integers with the following values:
Name this D ArrayList Data
Run a method named SearchEven. Pass Data as an argument to the SearchEven method. SearchEven will return a D ArrayList. This ArrayList will contain the rows and columns of where each even number in the D parameter is located. If the D ArrayList contains no even numbers, the ArrayList returned will only contain the value
Use a separate method to display the contents of the ArrayList that SearchEven returns. If Data contained at least even number, then output one row and column per line. If Data did not contain any even numbers, then display a message that indicates this. Name this method: DisplayLocations.
Run the method SearchEven again. Pass Data as an argument to the SearchEven method.
Use the DisplayLocations method to display the contents of the ArrayList that SearchEven returns. If Data did not contain any even numbers, then display a message that indicates this.
Sample RunNotes:
This program needs to work with D ArrayLists of integers of any size.
The D ArrayLists can have any nonnegative number of rows.
Each row can have any nonnegative number of elements.
Making an algorithm before attempting to code this program will be helpful to you.
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