Adding digit of an integer upto single digit sum


import java.util.Scanner;
public class AddDigitUpToSingleDigit {
public static void main(String[] arg) {
Scanner in = new Scanner(System.in);
System.out.print("Input a positive integer: ");
int n = in.nextInt();
if (n>0)
{
System.out.print("The single digit number is: "+(n == 0 ? 0 :
                                (n % 9 == 0 ? 9 : n % 9)));
}
System.out.println("\n");
}
}

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