Searching Key and finding value associated with it in a HashTable

 

import java.util.Hashtable;
import java.util.Scanner;

public class FindSizeAndKey {

public static void main(String[] args) {
Hashtable<Integer, String> ht = new Hashtable<>();
//adding element to our HashTable
ht.put(1, "Vidya");
ht.put(2, "Sambhavna");
ht.put(3, "Tina");
ht.put(4, "Gravit");
ht.put(5, "Anmol");
ht.put(6, "Veer");
//finding size of our HashTable
System.out.println("Size of Table is = " + ht.size());
//checking if a key is present in the table or not
Scanner sc = new Scanner(System.in);
System.out.println("Enter the key you want to find");
int key = sc.nextInt();
if (ht.containsKey(key)) {
String value = ht.get(key);
System.out.println(
"The value stored at key " + key + " is --->>> " + value
);
}
}
}

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