$PKGLINE /** * This is a base template for IBIO algorithms * * @author (your name) * @version (a version number or a date) */ public class $CLASSNAME { // example Class data member, in fond memory of the late Douglas Adams private int d = 42; // "the answer to life, the universe and everything" public static void main(String[] args) { new $CLASSNAME(); } /** * Constructor for objects of class $CLASSNAME */ public $CLASSNAME() { // valid Java or JETS statements may be placed here... output("The answer is: " + d); } /** * IBIO methods, (c) International Baccalaureate 2003 * Computer Science Subject Guide, Appendix 2. */ static void output(String info) { System.out.println(info); } static void output(double info) { System.out.println(info); } static void output(int info) { System.out.println(info); } static int inputInt(String Prompt) { int result=0; try{result=Integer.parseInt(input(Prompt).trim());} catch (Exception e){result = 0;} return result; } static double inputDouble(String Prompt) { double result=0; try{result=Double.valueOf(input(Prompt).trim()).doubleValue();} catch (Exception e){result = 0;} return result; } static String input(String prompt) { String inputLine = ""; System.out.print(prompt); try { java.io.InputStreamReader sys = new java.io.InputStreamReader(System.in); java.io.BufferedReader inBuffer = new java.io.BufferedReader(sys); inputLine = inBuffer.readLine(); } catch (Exception e) { String err = e.toString(); System.out.println(err); } return inputLine; } static String input() { return input(""); } }