Java Program to show Bound Generic Data Type

 

class States<T extends Number> {
T[] num;
//constructor
States(T[] obj) {
num = obj;
}
// method to calculate average
double cal_Average() {
double sum = 0.0;
for (int i = 0; i < num.length; i++) {
sum += num[i].doubleValue();

}
return (sum / num.length);
}
} //class containing driver method
class BoundDemo {
//driver method
public static void main(String[] args) {
Integer[] arr = { 1, 2, 3, 4, 5 };
States<Integer> t = new States<>(arr);
double avg = t.cal_Average();
System.out.println(avg);
}
}

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