Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please start your code after ' Begin your work here'. All the rest of code has been given. YOU just need to write a part

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

please start your code after ' Begin your work here'. All the rest of code has been given. YOU just need to write a part of the code, which is from 'Begin work here' to 'End work here'.

Details of findAndRemoveCard() method * ====Method for you to complete==== * Looks for a card (string) in a player's hana (string array). If found, it replaces it * with an "X" and returns "FOUND". If not, it returns "NOT FOUND". * @param cardToFind String card to look for, and if found replace with an "X" * @param cardsInHand String array of all cards (strings) in hand * @return String "NOT FOUND" if card is not found in hand, or "FOUND" if it is. Input: Parameters The method will take the following parameters: a string (cardToFind): String card to look for (within the following string array), and if found replace with an "X" a string array (cards InHand): String array of all cards (strings) in hand Processing Look through the string array (cards InHand) for the string provided (cardToFind). If you find it, replace it with an "X" and return "FOUND". If you do not find the string (cardToFind), return "NOT FOUND". Output: Return value The method will return the string "NOT FOUND" if card is not found in hand, or "FOUND" if it is. Sample method input/output: findAndRemoveCard () Input arguments findAndRemoveCard () Output (return values) cards InHand array after leaving method G5 {R2,73,55,B4} FOUND {R2,43,X, B4} B7 NOT FOUND {R2,Y3, G5,B4} {R2, 73, G5,B4} import java.util.Scanner; - public class PoD { * ====Method for you to complete==== * Looks for a card (string) in a player's hand (string array). If found, it replaces it * with an "X" and returns "FOUND". If not, it returns "NOT FOUND". * @param cardToFind String card to look for, and if found replace with an "X" * @param cardsInHand String array of all cards (strings) in hand * @return String "NOT FOUND" if card is not found in hand, or "FOUND" if it is. public static String findAndRemoveCard(String cardToFind, String[] cards InHand) { // BEGIN WORK HERE for (int i=0; i 0) { System.out.print(cards InHand[i]+ " - "); System.out.println(cardsInHand[n-1]); } public static void readInCards(String[] cardsInHand) { for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago