Question: easyString ChallengeHave the function stringchall enge ( sen ) take the sen parameter being passed andreturn the longest word in the string. If thereare two
easyString ChallengeHave the function stringchall enge sentake the sen parameter being passed andreturn the longest word in the string. If thereare two or more words that are the samelength, return the first word from the string withthat length. Ignore punctuation and assumesen Will not be empty. Words may also containnumbers, for example Hello worldOnce your function is working, take the finaloutput string and replace all characters thatappear in your challengeToken with CHARYour ChallengeToken: IcxeaExamplesInput: fun& tineOutput: tineFinal Output: tineInput: "I love dogs"Output: loveJavaimport java.util.;import java.io;class Main fpublic static String StringChallenge String sen code goes herereturn sen;public static void main String args keep this function call hereScanners new ScannerSystemin;System.out. print StringChallenge snextLine; and give code in java
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
