A method named getUserStringsAndPopulate Array(). This method should keep prompting the user to enter as many strings as the user wants. The user should be able to stop entering strings by entering EXIT. This method should take the strings entered by the user and populate a one-dimensional array of strings with the user input. The string EXIT should NOT be added to the array because it is a special flag that will tell the method to stop prompting the user to enter more strings. This method should return the one-dimensional array of strings populated with user input and should not accept any arguments. 2.b) A method named searchArray() that would accept a one-dimensional array of strings and search the array for the string Winter. The search logic should NOT be case sensitive. If a match is found, this method should print the string in the array followed by a message like "  --- Found a match!". Otherwise, the method should not print anything. This method should NOT return anything.  2.c) A method named printStrings() that would print all strings in all uppercase letters followed by three spaces, followed by the first character extracted, followed by three - characters, followed by the fifth character extracted, followed by three - characters, followed by the last character extracted. Each string with its extracted characters should be printed on its own separate line. The method should throw an exception with a proper message if the string has fewer than 5 characters or if the string is empty. This method should NOT return anything.  Note: The case of the extracted characters should NOT be changed.   3) In the Main() method, first call the getUserStringsAndPopulate Array() method to create and populate the array. Then call the searchArray() method to search the array, Then call the printStrings() method to print the strings and their extracted characters.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

A method named getUserStringsAndPopulate Array(). This method should keep prompting the user to enter as many strings as the user wants. The user should be able to stop entering strings by entering EXIT. This method should take the strings entered by the user and populate a one-dimensional array of strings with the user input. The string EXIT should NOT be added to the array because it is a special flag that will tell the method to stop prompting the user to enter more strings. This method should return the one-dimensional array of strings populated with user input and should not accept any arguments.

2.b) A method named searchArray() that would accept a one-dimensional array of strings and search the array for the string Winter. The search logic should NOT be case sensitive. If a match is found, this method should print the string in the array followed by a message like "  --- Found a match!". Otherwise, the method should not print anything. This method should NOT return anything. 

2.c) A method named printStrings() that would print all strings in all uppercase letters followed by three spaces, followed by the first character extracted, followed by three - characters, followed by the fifth character extracted, followed by three - characters, followed by the last character extracted. Each string with its extracted characters should be printed on its own separate line. The method should throw an exception with a proper message if the string has fewer than 5 characters or if the string is empty. This method should NOT return anything. 

Note: The case of the extracted characters should NOT be changed.

 

3) In the Main() method, first call the getUserStringsAndPopulate Array() method to create and populate the array. Then call the searchArray() method to search the array, Then call the printStrings() method to print the strings and their extracted characters. 

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT