a. Write an application that accepts up to 20 Strings, or fewer if the user enters a

Question:

a. Write an application that accepts up to 20 Strings, or fewer if the user enters a terminating value. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. 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 a requested list has no Strings, 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: