Question: Fill in the code below. Specifically, create a String array that contains following values in main() : hi, hello, yo, sup, howdy, hiya, greetings Also

Fill in the code below. Specifically, create a String array that contains following values in main():

"hi", "hello", "yo", "sup", "howdy", "hiya", "greetings"

Also in main(), ask the user to input a String to search for in the array. Write a method named searchArray() that takes the users input and the array, and returns either the index of the element that matches the query or -1 if the query is not in the array. In main(), output appropriate messages to inform the user of the search result.

Can someone help me with this problem?

java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!