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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education