Question: Keyboard Input Create a program called EightLines.java. This program should read in exactly eight lines of text ( as returned by Scanner.nextLine ( ) )
Keyboard InputCreate a program called EightLines.java. This program should read in exactly eight lines of text asreturned by Scanner.nextLine from the keyboard input. Each line may contain or morewordsA word is any set of nonspace characters, separated from other words on the same line byone or more spaces. Each input word should be printed alone on a line.What kinds of test cases can you think of Lines with or more than words Fewer than exactly or more than input lines. How do you detect if the input containsfewer than lines? What method should you use?If an input line contains no words, what should the program do The specification says only to printwords at the input, so such lines should be "counted as lines" but should not yield any output.How do you want to get each word from each line? You could use String.split or you couldmake a new Scanner for the line, reading from the String that contains the line.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
