Question: Reading: Chapter 4 of the locture notes (algorithm analysis). Relevant topics: recuraion, array lists, binary search. Write a program that reads a line of text
Reading: Chapter 4 of the locture notes (algorithm analysis). Relevant topics: recuraion, array lists, binary search. Write a program that reads a line of text from the standard input and prints out the input string but with blanks inserted so that the output is a sequence of English words. Thke "English words" to mean words in the file words.txt on Canvas and Vocareum. The input is a string of lower-case letters (no punctuation or blanks). The output is the same string but with blanks inserted so that each string delimited by the blanks is a word in words.txt. If it is not possible to produce such a string, your program should print out "mull". Name your program Extract Words and upload it to Vocareum. For example, if the input is: fourscoreandsevenyearsago then a correct output is four score and seven years ago If there is more than one correct output, then your program should print only one. For example, if the input is: "formany" then your program could print out either "for many" or "form any" (not both). The output does not need to make sense. For example, if the input is "butthough", then one correct output. is "but though". Another correct output is "butt ho ugh". Two aample input fles, Gettyaburg and Briarlose, are on Canvas and Vasareum. Your program should be able to process either of those in under 5 seconds for full credit. Upload your solution to Vocareum. The starter code Starter.java on Vocareum reads in words.txt and finds the length of the longest word: Exercises (not to turn in): (1) Consider a string of n letters. How many different strings can be formed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
