2a) Write a method countEvens that takes an ArrayList of String objects as input
ID: 663311 • Letter: 2
Question
2a) Write a method countEvens that takes an ArrayList of String objects as input and returns the number of even length strings contained in the input. For example, if the input is [one, peach, pear, plum] then countEvents(inp) should return 2. 2b) Write a method, mirror, that doubles the size of a list of integers by appending a mirror image of the list. For example, given an array list containing [ 1, 5, 2, 6 ], the method should return an array list containing [ 1, 5, 2, 6, 6, 2, 5, 1 ]. Use the ArrayList data structure to represent the input and output of this method.Explanation / Answer
1
odd chars
even chars
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.