Reference: https://apcentral.collegeboard.org/media/pdf/ap24-frq-comp-sci-a.pdf
Topics:
Strings - Comparison (contains & equals) & Substring
Objects
ArrayLists - Loops, Get, & Add
Good project for ArrayLists unit.
Because the problem comes from the AP CS A test, the expectation is that only the functions you're told to write have to be implemented. Having said that, for testing on a computer, You will sometimes need additional functions/code.Â
Here's the expected additions you'll need (beyond the functions described):
Constructor that takes in an ArrayList of Strings and sets wordList to it.
Pay close attention to what is being asked:
The 2nd function asks you to grab the end portion of the matched String - if the target is "cat" and it's checking to see if it matches the start of "catch", then the "ch" is what is saved into the list.