[Solved]Java Write Method Check Prefix Two Strings 3 Characters 3 Char Prefix Word Class Cla Meth Q37114297
In Java!!
Write a method to check prefix of two strings that have morethan 3 characters. A 3-char prefix of a word “class” will be “cla”.The method should take two strings as parameters, then compare3-char prefix of two strings.
Write a method to check suffix of two strings that have morethan 3 characters. A 3-char suffix of a word “world” will be “rld”.The method should take two strings as parameters, then compare3-char suffix of two strings.
Detail requirements of the methods are below:
Requirements:
-
Use Scanner object to take strings input from console.
-
Both methods should check the length of the input strings first.If any string is less than 3 characters, the method should show“String too short, please re-enter.” And ask inputs again untilboth strings equal or more than 3 characters.
-
If prefix or suffix matches, it should show “3-char prefixmatched” or “3-char suffix matched”, and also show the matched 3characters.
-
If prefix or suffix does not match, it should show “3-charprefix didn’t match” or “3-char suffix didn’t match”.
-
Test your methods with different inputs. Take screenshots formatched results, and not-matched results.
Expert Answer
Answer to In Java!! Write a method to check prefix of two strings that have more than 3 characters. A 3-char prefix of a word “… . . .
OR

