(Solved):JAVA – (1) Prompt the user to enter a string of their choosing. Output the string. (2) Complete the getNumOfCharacters() method, which returns the number of characters in the user’s string. We enc… View Answer…

 

Question

JAVA –

(1) Prompt the user to enter a string of their choosing. Output the string.

(2) Complete the getNumOfCharacters() method, which returns the number of characters in the user’s string. We encourage you to use a for loop in this function.

(3) In main(), call the getNumOfCharacters() method and then output the returned result.

(4) Implement the outputWithoutWhitespace() method, which outputs the string’s characters except

Scroll to top