Sum and average of given element in an Array

 import java.util.*;


public class ArrayAvg {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the size of Array");
int size = sc.nextInt();
int arr[] = new int[size];

System.out.println("Input the Array");

int sum = 0;
for (int i = 0; i < size; i++) {
arr[i] = sc.nextInt();
sum = sum + i;
}
System.out.println("Sum of the given array is : " + sum);
System.out.println("Average of the given array is :" + sum / size);

int counter = 0;
for (int i = 0; i < arr.length; i++) {
if (arr[i] > sum / size) {
counter++;
}

}
System.out.println("Average of array is less than " + counter + " " + "elements of array");
}
}

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