Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java code. Looking for a simple solution to learn from. I\'m looking for method

ID: 3710531 • Letter: J

Question

Java code. Looking for a simple solution to learn from.

I'm looking for method that uses Stack to convert the passed string (case insensitive) to uppercase form. For example:

"Wooorrrrrllld" without quotes, it should return "WO3R5L3D".

"Maaaaaanny" without qutes, it should return "MA6N2Y"

If it's only one character, do not return the number 1 next to it.

For a starting method please use "public static String myFunction(String myString)".

myString is a String that is passed in.

The return should return the string with the number of occurences as the examples above.

However, if the string passed in is null or empty, it should return null.

Explanation / Answer

Hi Dear,

Please find my implementation.

Output:

WO3R5L3D
MA6N2Y

Process finished with exit code 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote