Page 1 of 1

Write a java program to ask user to input four lines. Your program will store the four lines in a String array (create a

Posted: Mon Jul 11, 2022 9:55 am
by answerhappygod
Write A Java Program To Ask User To Input Four Lines Your Program Will Store The Four Lines In A String Array Create A 1
Write A Java Program To Ask User To Input Four Lines Your Program Will Store The Four Lines In A String Array Create A 1 (30.18 KiB) Viewed 44 times
IN JAVA AND PLEASE FOLLOW THE INSTRUCTIONS ABOVE
Write a java program to ask user to input four lines. Your program will store the four lines in a String array (create a String array of size 4). Once the input is complete, your program will output the total number of words in the String array and print all words on a separate line. PS: Use StringTokenizer class to count and print tokens. A sample output of the program is given below. Input any four lines Enter line 1: Twinkle, twinkle, little star, Enter line 2: How I wonder what you are! Enter line 3: Up above the world so high, Enter line 4: Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Total words in 4 lines: 22