Comparing Arrays Using Iterative Method

 

import java.util.*;

public class ArraysEqualOrNot {
public static void compareArray(int arr1[], int arr2[]) {
boolean equalOrNot = true;
if (arr1.length == arr2.length) {
for (int i = 0; i < arr1.length; i++) {

if (arr1[i] != arr2[i]) {
equalOrNot = false;
}
}
} else {
equalOrNot = false;
}
if (equalOrNot == false) {
System.out.println("The given Arrays are not equal");
} else {
System.out.println("The given Arrays are equal");
}

}

public static void main(String args[]) {
int arr1[] = { 12, 14, 16, 12, 18, 20 };
int arr2[] = { 12, 14, 16, 12, 18, 21 };
compareArray(arr1, arr2);
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...