Comparing a floating number using Conditions

 

import java.util.Scanner;
public class FloatingNumber {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter a number");
float a = sc.nextFloat();

if (a == 0) {
System.out.println("The given number is ZERO");
} else if (a < 1) {
System.out.println("The given number is small");
} else if (a > 1000000) {
System.out.println("The given number is large");
} else if (a > 1 && a < 1000000) {
System.out.println("The given number is positive");
} else {
System.out.println("The given number is negative");
}

}
}

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