Computer Science 210
Data Structures

Fall 2017, Siena College

BaaBaaBad BlueJ Project

Click here to download a BlueJ project for BaaBaaBad.


BaaBaaBad Source Code

The Java source code for BaaBaaBad is below. Click on a file name to download it.


BaaBaaBad.java

/*
 * Example BaaBaaBad: some repetetive lyrics printed out.
 *
 * Jim Teresco, The College of Saint Rose, CSC 202, Fall 2012
 *
 * $Id$
 */

public class BaaBaaBad {

    public static void main(String[] args) {

        // the refrain
        System.out.println("Baa, baa, black sheep,");
        System.out.println("Have you any wool?");
        System.out.println("Yes sir, yes sir,");
        System.out.println("Three bags full.");

        // the verse
        System.out.println("One for the master,");
        System.out.println("One for the dame,");
        System.out.println("And one for the little boy");
        System.out.println("Who lives down the lane.");

        // the refrain again -- we copy and paste the 
        // 4 printlns above for this
        System.out.println("Baa, baa, black sheep,");
        System.out.println("Have you any wool?");
        System.out.println("Yes sir, yes sir,");
        System.out.println("Three bags full.");
    }
}