   import java.io.*;
   import java.util.*;
/***********************************************
* @author - Matthew Bernardo 
* @version - V1 - January 22, 2007
* Lab 4
* Section 1
************************************************/
/*
/ References and Ackknowledgements: I have recieved 
/ no help on this programming assignment
/
/***********************************************/


    public class IO_bernarmj_Remember
   {
      private static Scanner        dateScanner; //scanner
      private static PrintWriter    screen;
      static         int            length; //length of args[]
      static         File         dates; //dates file
   static           String[]        name;  
       public static void main(String[] args) throws IOException
      {
         GregorianCalendar        today; //today object
            FileWriter fwriter = new FileWriter(dates);  
         PrintWriter outputfile = new PrintWriter(fwriter);
           
         today    = new GregorianCalendar();
         screen   = new PrintWriter(System.out);
         length = args.length;
         name = new String[length];//setting the size of the dates array
        
         for(int ii = 0; ii < args.length; ii++) //setting each of the arguments of file names to one of the date indexes
         {
            name[ii] = args[ii];
            outputfile.println(name[ii]);
         }
                
         screen.printf(Locale.US, "\nToday's Date: %1$te %1$tB %1$tY\n", today);
         screen.flush();       
         
                      
         processDates(today);
      }
    
   
   
       private static void processDates(GregorianCalendar today)
      {
         int           day, month;              
         String        name;
       
      
       // Use the '\t' (tab) and '/' characters as delimiters
         dateScanner.useDelimiter("[\t/]");
          
         try //try block
         {
            for(int ii = 0; ii < length; ii++) //looping the number of times as their are arguments
            {
               dateScanner = new Scanner(dates); //reading the files
            
               while (dateScanner.hasNext())
               {
                  month = dateScanner.nextInt(); //getting the month
                  day   = dateScanner.nextInt(); //getting the day
                  name  = dateScanner.nextLine();//getting the name
               
                  if ((month == (today.get(Calendar.MONTH + 1))) && 
                  (day == today.get(Calendar.DAY_OF_MONTH)))
                  {
                     screen.printf("%s\n", name);
                     screen.flush();
                  }
              else
              {
              System.out.print("done");
              }
               }
            }
         }
         
             catch(FileNotFoundException fnfe)
            {
               System.out.print("The file was not found!");
            }
      
          
      }
    
   
   }
