/*****************************************************************
** DaysToSummer - output the number of days to summer
**
** This program has three possible outcomes.  These are
**
** 1. If summer has yet to arrive, the output is
**
**       n days(s) to summer
**
** 2. If summer begins today, the output is
**
**       Summer begins today!
**
** 3. If the beginning of summer preceded the current day, the
**    output is
**
**       Summer began n day(s) ago
**
** 'n' is the number of days.
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.util.*;

public class DaysToSummer
{
   public static void main(String[] args)
   {      
      Calendar today = new GregorianCalendar();

      Calendar summerStart =
         new GregorianCalendar(today.get(Calendar.YEAR), Calendar.JUNE, 21);

      int days = summerStart.get(Calendar.DAY_OF_YEAR) -
            today.get(Calendar.DAY_OF_YEAR);

      if (days > 0)
         System.out.println(days + " day(s) to summer");
      else if (days == 0)
         System.out.println("Summer begins today!");
      else
         System.out.println("Summer began " + -days + " day(s) ago");
   }
}

