/*****************************************************************
** QuoteOfTheDay - output a quote-of-the-day! 
** 
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.util.*;

public class QuoteOfTheDay
{
   // quotes are a good candidate for an array of string constants
   private static final String[] QUOTE =
   {
      "\'Fuddle duddle\', Trudeau",
      "\'Fly on, little wing\', Hendrix",
      "\'Yubba dubba do', Fred Flintstone",
      "\'Blood, sweat, and tears\', Churchill",
      "\'I didn't inhale\', Clinton",
      "\'Look up, look way up\', Friendly Giant",
      "\'It ain\'t over \'til it\'s over\', Yogi Berra",
   };

   public static void main(String[] args) 
   {
      // instantiate a Random object
      Random quoteNumber = new Random();

      // get a random integer
      int i = quoteNumber.nextInt();

      // make sure it's zero or positive
      i = Math.abs(i);

      // constrain the index, as per the number of quotes
      i = i % QUOTE.length;

      // output today's quote
      System.out.println("Today's quote...");
      System.out.println("\n\t" + QUOTE[i]);
   }
}

