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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 41 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply