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.
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.
Step by step
Solved in 4 steps with 4 images