import java.util.Random; /** Program to test reaction time. */ class Reaction { // We have to declare that main can throw an exception, because // the sleep call can throw an InterruptedException. public static void main(String[] args) throws InterruptedException { Random rand = new Random(); // This sleeps for 1000 ms (1 second), but you should instead // use the rand object to pick a random number of ms to sleep. Thread.sleep(1000); System.out.println("Hit Enter!"); // Insert timing code, check for when Enter is hit // (using System.in.read()), and print results. } }