Computer Science 202
Introduction to Programming
Fall 2012, The College of Saint Rose
BaaBaaBad BlueJ Project
Click here to download a BlueJ project for BaaBaaBad.
Download file: BaaBaaBad.vls
BaaBaaBad Source Code
The Java source code for BaaBaaBad is below. Click on a file name to download it.
/* * Example BaaBaaBad: some repetetive lyrics printed out. * * Jim Teresco, The College of Saint Rose, CSC 202, Fall 2012 * * $Id: BaaBaaBad.java 1975 2012-11-07 18:41:56Z terescoj $ */ 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."); } }