import java.util.Scanner;

/**

* This program will print out a modified version of the song

* 100 bottles of beer on the wall

*

* @author - Elizabeth Adams

* @version - 1f

*/

 

public class Lab1f

{

   public static void main(String args [])

   {

      Scanner scan;

      int numberOfBottles;

           

      scan = new Scanner(System.in);

 

      System.out.println("Enter a number between 0 and 101"); 

      numberOfBottles = scan.nextInt(); // converts input to an int

    

    // repeat following section of code until numberOfBottles is in desired range

      while (numberOfBottles <= 0 || numberOfBottles > 100)

      {

           System.out.println("Enter a number between 0 and 101");

           numberOfBottles = scan.nextInt(); // gets another int

      } // end while

     

          // repeat following code until numberOfBottles leaves desired range            

      while (numberOfBottles > 0 && numberOfBottles <= 100)

      {

         if (numberOfBottles > 2)

            numberOfBottles = PrintVerse.normalStanza(numberOfBottles);

         else if (numberOfBottles == 2)

            numberOfBottles = PrintVerse.almostDone();

         else

            numberOfBottles = PrintVerse.lastStanza();

       } // end while

   } // end of main

} // end of class