Calculating total factors of a number using square root method

 import java.util.*;




public class PrintFactor1{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter an integer");
int n = sc.nextInt();
System.out.println(calculateFactor(n));
}

public static int calculateFactor(int n){
int counter = 0;
for(int i=1; i<=(int)Math.sqrt(n);i++){
if(n%i==0 && i*i!=n){
counter +=2;
} else if(i*i==n){
counter+=1;
}
}
return counter;
}
}

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