Define a method that searches an array for a value. It shouldtake the target value and the array as input parameters. If thevalue is found, the method returns its index position; otherwise,the method returns — 1. You can use the algorithm from Chapter 2 ifyou like. Test your method bypassing values into it, asking theuser for a target value, running a search, and displaying theappropriate message about the outcome of the search.
Expert Answer
An answer will be send to you shortly. . . . .