/*****************************************************************
 * Program:          Bingo
 *
 * Author:           Mark Rich   richm@cs.wisc.edu
 *
 * Completion Date:  March 5, 2001
 * 
 * Course:           CS 302, Spring 2000, Section 8 & 10
 * 
 * Compiler:         JDK 1.2.1
 * Platform:         Solaris
 *****************************************************************/

/**
 * This class implements the cool childhood song of BINGO.  Here,
 * we demonstrate the use of for loop and unbroken switch statements.
 * Three nested for loops are cool. :)
 *
 * Bugs known: None
 **/
class Bingo {

    public static void main (String[] args) {
	
	// The first for loop, to take care of each verse
	for (int verses = 0; verses <= 5; verses++) {

	    // These phrases are repeated verbatim every single time
	    // with only the verse number changing
	    System.out.println("VERSE " + (verses + 1));
	    System.out.println("");
	    System.out.println("There was a farmer who had a dog,");
	    System.out.println("And Bingo was his name-o.");
	    
	    // The second for loop, taking care of the clapping and
	    // spelling of BINGO
	    for (int times = 0; times < 3; times++) {

		// The THIRD for loop, now we take care of the number
		// of claps per verse.  This increases as the verse
		// number goes up.
		for (int claps = 0; claps < verses; claps++) {
		    System.out.print("CLAP! ");
		}

		// Uh Oh, a switch without breaks!  Now as the number
		// of verses increases, the letters are replaced with 
		// claps. We use a switch statement where one
		// less letter is printed out each time.
		switch(verses) {
		    case 0: System.out.print("B ");
		    case 1: System.out.print("I ");
		    case 2: System.out.print("N ");
		    case 3: System.out.print("G ");
		    case 4: System.out.print("O ");
		}

		// End of each inner loop, you should add on a 
		// comma for the English majors in the croud.
		System.out.println(",");
	    }

	    // Finally, we print out the last line of each verse.
	    System.out.println("And Bingo was his name-o.");
	    System.out.println("");
	}
    }
}

/**
 Sample output...

VERSE 1

There was a farmer who had a dog,
And Bingo was his name-o.
B I N G O ,
B I N G O ,
B I N G O ,
And Bingo was his name-o.

VERSE 2

There was a farmer who had a dog,
And Bingo was his name-o.
CLAP! I N G O ,
CLAP! I N G O ,
CLAP! I N G O ,
And Bingo was his name-o.

VERSE 3

There was a farmer who had a dog,
And Bingo was his name-o.
CLAP! CLAP! N G O ,
CLAP! CLAP! N G O ,
CLAP! CLAP! N G O ,
And Bingo was his name-o.

VERSE 4

There was a farmer who had a dog,
And Bingo was his name-o.
CLAP! CLAP! CLAP! G O ,
CLAP! CLAP! CLAP! G O ,
CLAP! CLAP! CLAP! G O ,
And Bingo was his name-o.

VERSE 5

There was a farmer who had a dog,
And Bingo was his name-o.
CLAP! CLAP! CLAP! CLAP! O ,
CLAP! CLAP! CLAP! CLAP! O ,
CLAP! CLAP! CLAP! CLAP! O ,
And Bingo was his name-o.

VERSE 6

There was a farmer who had a dog,
And Bingo was his name-o.
CLAP! CLAP! CLAP! CLAP! CLAP! ,
CLAP! CLAP! CLAP! CLAP! CLAP! ,
CLAP! CLAP! CLAP! CLAP! CLAP! ,
And Bingo was his name-o.

**/







