/***********************************************************
 * This program calculates today's date and then reads the
 * inputted file to determine if anything of note is happening.
 ***********************************************************
 *
 * Ryan Decker
 * Version 1
 *	January 22, 2007
 */
import java.io.*;
import java.util.*;


public class IO_deckerrw_Remember
{
    private static Scanner        dateScanner;
    private static PrintWriter    screen; // alternative to typing System.out
    


    public static void main(String[] args)
    {
       GregorianCalendar        today; // used to find out today's date
       String                   name;       
		 File							  dates;
       
       today    = new GregorianCalendar();
       screen   = new PrintWriter(System.out);

		 name = String.format(Locale.US, "\nToday's Date: %1$te %1$tB %1$tY\n", today);
       screen.print(name);
       screen.flush(); // forces the buffer to empty into output    

		 dates = new File(name); // creates the file using the information in names
       dateScanner = new Scanner(System.in);


       processDates(today, dates);
    }
    


    private static void processDates(GregorianCalendar today, File dates)
    {
       int           day, month;              
       String        name;
             
       // Uses the File "dates" as a delimiter
       dateScanner.useDelimiter(dates);
          
       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();
          }
       }
    }
    

}