Question: 12.6 Prog 6 Text analyzer & modifier (method) Write a program to input a string. count the number of characters in the string, and then
12.6 Prog 6 Text analyzer \& modifier (method) Write a program to input a string. count the number of characters in the string, and then output the string without whitespace. The program MusT have the following two methods, in additional to the main method: (1) A method named getNumorcharacters, which teturns the number of characters in the users string (a for loop should be used in this method, the header of the method should be publio static int getNumofCharactera (String) (2) A method named outputwithoutWhitespace that outputs the string's characters except for whitespace (spaces, tabs). Note; A tab is it. the header of the method should be public void outputWithoutWhiteaplace (string) in main0 method, call these two methods. Here is an example of an output Enter a sentence or phrase: You entered: The only thing we have to fear io fear itaelf. Number of charactera: 46 String with no whiteapace; Theonlythingwehavetofearisfearitself
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
