Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2a) Write a method countEvens that takes an ArrayList of String objects as input

ID: 665599 • 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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote