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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!