UNB/ CS/ David Bremner/ teaching/ java/ NumberEntry.java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class NumberEntry{

    public static void main(String[] args) throws IOException{
        BufferedReader  reader = 
               new BufferedReader(new InputStreamReader(System.in)); 
        boolean ok=false;
        while(!ok){
            System.out.println("enter a number");
            System.out.print(">>");
            String s=reader.readLine();
            ok=true;
            try{
                double d=Double.parseDouble(s);
            } 
            catch (NumberFormatException e){
                System.out.println("That is not a number!");
                ok=false;
            }
        }
    }
}