/**
 * Name: Travis McGaha
 *
 * PennKey: tqmcgaha
 *
 * Execution: java BottlesOfBeer
 *
 * Description: A program that prints out the lyrics to "99 Bottles of Beer".
 */
public class BottlesOfBeer {
    public static void main(String[] args) {
        int bottles = 99;
        
        while(bottles > 0) {
            // split cases based on whether we need to make "bottle" plural or not
            // e.g. "bottle" vs "bottles"
            if (bottles > 2) {
                System.out.println(bottles + " bottles of beer on the wall");
                System.out.println(bottles + " bottles of beer");
                System.out.println("take one down, pass it around");
                System.out.println((bottles - 1) +" bottles of beer on the wall");
            } else if (bottles == 2) {
                System.out.println(bottles + " bottles of beer on the wall");
                System.out.println(bottles + " bottles of beer");
                System.out.println("take one down, pass it around");
                System.out.println((bottles - 1) +" bottle of beer on the wall");
            } else {
                // implicitly, this is the case where bottles == 1
                System.out.println(bottles + " bottle of beer on the wall");
                System.out.println(bottles + " bottle of beer");
                System.out.println("take one down, pass it around");
                System.out.println((bottles - 1) +" bottles of beer on the wall");
            }

            // blank line to make the output easier to read
            System.out.println();
            bottles = bottles - 1;
        }

        // the "end" of the song
        System.out.println("No more bottles of beer on the wall, no more bottles of beer.");
        System.out.println("We've taken them down and passed them around; now we're drunk and passed out!");
    }
}
