//********************************************************************
//  Age.java       Author: Lewis/Loftus
//
//  Demonstrates the use of an if statement.
//********************************************************************

import cs1.Keyboard;

public class Age2Logical
{
   //-----------------------------------------------------------------
   //  Reads the user's age and prints comments accordingly.
   //-----------------------------------------------------------------
   public static void main (String[] args)
   {
      final int MINOR = 21;

      System.out.print ("Enter your age: ");
      int age = Keyboard.readInt();

      System.out.println ("You entered: " + age);

      if (age < MINOR)
         System.out.println ("Youth is a wonderful thing. Enjoy.");
         
      if (age >= MINOR && age < 30 )
         System.out.println ("Still young, but wiser.");
      
      if ( age >= 30 && age < 40)
         System.out.println ("Approaching midlife.  Don't worry, be happy");
      
      if (age >= 40 && age < 50)
         System.out.println ("Still kicking and having a blast.");
      
      if ( age >= 50 )
         System.out.println ("You've still got lots of life left.");

      System.out.println ("Age is a state of mind.");
   }
}
