In: Computer Science
public boolean areArrays(int[] arr1, int[] arr2){
// 1. initial check: both arrays need to have the same length,
return false if not the same
// 2. return true if both given arrays are equals(same values in
the same indices), false otherwise
if(arr1.length != arr2.length){
return false;
}
for(int i = 0; i < arr1.length; i++){
if(arr1[i] != arr2[i]){
}
}
return true;
}
public int getIndexOfWord(String[] arr, String word){
// if found, return the index of word, otherwise return -1
for(int i = 0; i < arr.length; i++){
if(arr[i].equals(word)){
return i;
}
}
return -1;
}
public boolean arrayContainsWord(String[] arr, String
word){
// return true if array contains specific word, false
otherwise
for(int i = 0; i < arr.length; i++){
if(arr[i].equals(word));
return true;
}
return false;
}
--- Scanner ------
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

class A {
  public static boolean areArrays(int[] arr1, int[] arr2) {
    // 1. initial check: both arrays need to have the same length, return false if not the same
    // 2. return true if both given arrays are equals(same values in the same indices), false otherwise
    if (arr1.length != arr2.length) {
      return false;
    }
    for (int i = 0; i < arr1.length; i++) {
      if (arr1[i] != arr2[i]) {
        return false;
      }
    }
    return true;
  }
  public static int getIndexOfWord(String[] arr, String word) {
    // if found, return the index of word, otherwise return -1
    for (int i = 0; i < arr.length; i++) {
      if (arr[i].equals(word)) {
        return i;
      }
    }
    return -1;
  }
  public static boolean arrayContainsWord(String[] arr, String word) {
    // return true if array contains specific word, false otherwise
    for (int i = 0; i < arr.length; i++) {
      if (arr[i].equals(word)) return true;
    }
    return false;
  }
  public static void main(String[] args) {
    int a[] = { 1, 2, 3 };
    int b[] = { 1, 2, 3 };
    int c[] = { 5, 42, 4 };
    String arr[] = {"HI","MY","name","is","Nikhil"};
    System.out.println(areArrays(a,b));
    System.out.println(areArrays(a,c));
    System.out.println(getIndexOfWord(arr, "is"));
    System.out.println(arrayContainsWord(arr, "ayush"));
  }
}