writing predicate and possible joining combination of predicates

 

/
import java.util.function.*;

class PredicateJoin {

  // method to print the numbers
  public static void printNum(Predicate<Integer> p, int[] x) {
    for (int i : x) {
      if (p.test(i)) {
        System.out.println(i);
      }
    }
  }

  //main method
  public static void main(String[] args) {
    int[] x = { 0, 5, 10, 15, 20, 25, 30 };
    //first predicate
    Predicate<Integer> p1 = i -> i > 10;
    //second predicate
    Predicate<Integer> p2 = i -> i % 2 == 0;
    System.out.println("The NUmbers Greater Than 10 :");
    printNum(p1, x);

    System.out.println("The Even Numbers are :");
    printNum(p2, x);

    System.out.println("The Numbers not Greater Than 10 :");
    printNum(p1.negate(), x);

    System.out.println("The Nmbers Greater Than 10 and Even :");
    printNum(p1.and(p2), x);

    System.out.println("The Numbers Greater Than 10 OR Even :");
    printNum(p1.or(p2), x);
  }
}

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...