Question: 6.16 Ch 6 Program: Authoring assistant (Java) import java.util.Scanner; public class AuthoringAssistant { public static int getNumOfWords(final String usrStr) { int count = 1;//there is
6.16 Ch 6 Program: Authoring assistant (Java)
import java.util.Scanner; public class AuthoringAssistant { public static int getNumOfWords(final String usrStr) { int count = 1;//there is atleast one word int i = 0; for (i = 1; i

10: Compare output A I want some water. I had some water earlier, but now he has some water. Input some water Enter a sample text: You entered: I want some water. I had some water earlier, but now he has MENU cNumber of non-whitespace characters wNumber of words f Find text r - Replace all 's sShorten spaces g-Quit Your output ends with Choose an option: Enter a word or phrase to be found:J Exception in thread "main" ava.lang.StringIndexOutofBoundsException: St at java.lang.String.substring (String.java:1931) AuthoringAssistant. findText (AuthoringAssistant .java : 43) AuthoringAssistant.main (AuthoringAssistant.java:121) at at Enter a word o phrase to be found:J Enter a word or phrase to be found: "some water" instances: MENU cNumber of non-whitespace characters Expected outputNumber of words ends with f - Find text r - Replace all 's sShorten spaces Qit Choose an option
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
