/*
 * JingleBells - a program that illustrates the use of procedural decomposition
 * to print the words to the song "Jingle Bells".
 *
 * Computer Science S-111
 */
public class JingleBells {
    /*
     * printVerse1 - print the first verse of the song.
     * 
     * NOTE: We use a separate method for this even though the verse is
     * never repeated. Using a separate method allows us to capture the
     * *structure* of the program, since printing a verse is a logical
     * subtask of the overall task.
     */
    public static void printVerse1() {
        System.out.println("Dashing through the snow in a one-horse open sleigh,");
        System.out.println("O'er the fields we go, laughing all the way.");
        System.out.println("Bells on bobtail ring, making spirits bright.");
        System.out.println("What fun it is to ride and sing a sleighing song tonight!");
    }
    
    /*
     * printVerse2 - print the first verse of the song.
     * 
     * The note accompanying printVerse1 also applies here.
     */
    public static void printVerse2() {
        System.out.println("A day or two ago, I thought I'd take a ride,");
        System.out.println("And soon Miss Fanny Bright was seated by my side.");
        System.out.println("The horse was lean and lank; misfortune seemed his lot;");
        System.out.println("We got into a drifted bank and then we got upsot.");
    }
    
    /*
     * printHalfRefrain - prints the two lines that are repeated to form
     * the refrain.
     * 
     * NOTE: Because there are only two lines that are repeated, we didn't
     * really need a separate method for the half refrain.
     * However, using one allows us to show that one non-main method
     * can be called by another non-main method.
     */
    public static void printHalfRefrain() {
            System.out.println("Jingle bells, jingle bells, jingle all the way!");
            System.out.println("O what fun it is to ride in a one-horse open sleigh!");
    }
    
    /*
     * printRefrain - prints the refrain of the song. Note that it calls
     * another non-main method to help it accomplish its task.
     */
    public static void printRefrain() {
        printHalfRefrain();
        printHalfRefrain();
    }
    
    public static void main(String[] args) {
        printVerse1();
        System.out.println();
        printRefrain();
        System.out.println();
        
        printVerse2();
        System.out.println();
        printRefrain();
    }
}