   import java.io.*;
   import java.util.*;

/***********************************************
 * This class takes in two files and prints out
 *	the results of what is going on during today's
 * date.
 *
 * @author -Danny Ziemer
 * @version - V1 - 1/22/2007
 * Lab4 
 * Section - 1
 **********************************************/
    public class IO_ziemerdp_Remember
   {
      private static Scanner        dateScanner;
      private static PrintWriter    screen;
    
   /*********************************************
   * This method takes in files from the command
   * line and prints out the information that is 
   * happening on todays date.
   *
   * @param args birthdays.txt
   * @param args assignments.txt
   *********************************************/
   
       public static void main(String[] args)
      {
         GregorianCalendar        today;
         String                   name;       
         File							  dates;
       
         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();
      	
         for(int count = 0; count < args.length; count++)//changes files that are being read
         {
            dates	 = new File(args[count]);//instantiates new file to be read from
                
            try 
            {
               dateScanner = new Scanner(dates);
            }
                catch(FileNotFoundException fnfe)//catches FNFE
               {
                  screen.println(fnfe.getMessage());//returns the FNFE orignial message
               }
            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();
            }
         }
      }
    
   
   }
