import java.io.*;
import java.util.*;

/**This program prompts the user to enter a number, calculates the square root
*  of the entered number and generates result on the computer screen.
*
*
*@author : Ravi Bhatia;   
*date : 01/22/2007    
*LAB4;  
*Section 1
*/


public class IO_bhatiarx_Remember
{
    private static Scanner        dateScanner;
    private static PrintWriter    screen;
    


    public static void main(String[] args) throws IOException //added later
    {
       String						  dates; // added later to declare a file name
		 Scanner						  keyboard;// added later to declare a Scanner object for reading filename from default system input
		 GregorianCalendar        today;
       String                   name;       

		 keyboard = new Scanner(System.in); //added later to instantiate keyboard 
   	 System.out.println("Enter a file name : ");//added later to prompt for file name input
		 dates	 = keyboard.nextLine();   //added later to instantiate file name
		 
       today    = new GregorianCalendar();
       screen   = new PrintWriter(System.out);

       screen.printf(Locale.US, "\nToday's Date: %1$te %1$tB %1$tY\n", today);
       screen.flush();  
		      
       dateScanner = new Scanner(new File(dates));//modified later to read from specified file
		 
       processDates(today);
	}
    


    private static void processDates(GregorianCalendar today)
    {
       int           day, month;              
       String        name;
       

       // Use the '\t' (tab) and '/' characters as delimiters
       dateScanner.useDelimiter("[\t/]");
      
   
          
       while (dateScanner.hasNext())
       { 
          month = dateScanner.nextInt();
			 day   = dateScanner.nextInt();
          name  = dateScanner.nextLine();
 
          if ((month == (today.get(Calendar.MONTH)+1)) && 
              (day   == today.get(Calendar.DAY_OF_MONTH)))
          {
             screen.printf("%s\n", name);
             screen.flush();
          }
       }
    }
    

}
