Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started