/** * Title: * Description: * Copyright: Copyright (c) 2001 * Company: * @author Henry Duran * @version 1.0 */ //MyInput.java: contain the methods for readign int, double, and string // values from the keyboard import java.io.*; public class MyInput { /**Read da string from the keyboard*/ public static String readString() { BufferedReader br =new BufferedReader (new InputStreamReader (System.in), 1); //declare and initialize the string String string =" "; //Get the string from the keyboard try { string = br.readLine(); } catch (IOException ex) { System.out.println(ex); } //return the string obtained from the keyboard return string; } /**read an int value from the keyboard*/ public static int readInt() { return Integer.parseInt(readString()); } /**read an double value from the keyboard*/ public static double readDouble() { return Double.parseDouble(readString()); } }