Question
Add method listByPlayer with String player parameter to search entire cards ArrayList and print ALL cards containing the player String: Use a local variable named
Add method listByPlayer with String player parameter to search entire cards ArrayList and print ALL cards containing the player String:
Use a local variable named found initialized to false
Use for-each loop to access each card in cards one at a time
Use external call to getPlayer to get the player info for the card
HINT: You may not need a local variable to store this
if the player card info .contains the player searching for, then print the card details using an external call to getDetails and set found to true (indicating at least 1 card was found)
(Only after ENTIRE search loop is completed - thus, outside of loop) if true that !found, print NO cards found for player:
Add method listByYear with int year parameter to search entire cards ArrayList and print ALL cards matching the year searching for:
Use a local variable named found initialized to false
Use for-each loop to access each card in cards one at a time
Use external call to getYear to get the year for the card
HINT: You may not need a local variable to store this
if the year on the card is the same year searching for, then print the card details using an external call to getDetails and set found to true (indicating at least 1 card was found)
(Only after ENTIRE search loop is completed - thus, outside of loop) if its true that !found, print NO cards found for year:
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