Answer:
Step-by-step explanation:
The following code is written in Java. It is a static method that takes in a String parameter and loops through the String array called arr comparing each element in the array with the word parameter that was passed. If it finds a match the method returns the index of that word, otherwise it will return -1
public static int findString(String word){
int index = -1;
for (int x = 0; x < arr.length; x++) {
if (word == arr[x]) {
index = x;
break;
}
}
return index;
}