Calculating sum of Digits of a number using Method

 import java.util.Scanner;



public class PrintDigitSum {

public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Input an integer: ");
int digits = sc.nextInt();
System.out.println("The sum is " + sumDigits(digits));
}

public static int sumDigits(long n) {
int result = 0;
while(n > 0) {
result += n % 10;
n /= 10;
}
return result;
}
}

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