Question: a. Write an application that accepts up to 10 Strings, or fewer if the user enters a terminating value. Divide the entered Strings into two

a. Write an application that accepts up to 10 Strings, or fewer if the user enters a terminating value. Divide the entered Strings into two lists—one for short Strings that are 10 characters or fewer and the other for long Strings. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If there are no Strings in a requested list, output an appropriate message. Prompt the user continuously until a sentinel value is entered. Save the file as CategorizeStrings.java.

b. Modify the CategorizeStrings application to divide the entered Strings into those that contain no spaces, one space, or more. After data entry is complete, continuously prompt the user to enter the type of String to display. If the user does not enter one of the three valid choices, display all of the Strings. Save the file as CategorizeStrings2.java.

Step by Step Solution

3.51 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a import javautil public class CategorizeStrings public static void main String args final int ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!