import java.io.*; /** Class to test MDateInvestigator (non-GUI) * * MD 10/20/2002 */ public class Proj1NonGUITester { public static void main(String[] args) { IDateInvestigator dateI = new MDateInvestigator(); System.out.println(dateI.getAuthor() + "'s " + dateI.getDescription()); BufferedReader inReader = new BufferedReader( new InputStreamReader(System.in)); while (true) { //prompt, read a line, and process it String oneLine = "nothing yet"; //to hold user input try { System.out.print("\nEnter a date to be investigated (or 'q' to quit): "); oneLine = inReader.readLine(); } catch (IOException e) { System.out.println("Oops, didn't expect to get " + e); break; //leave the while loop } if (oneLine.toLowerCase().indexOf('q') == 0) { break; } dateI.setDate(oneLine); System.out.println(dateI.dateInformation()); } System.out.println("Bye-bye"); } }