According to the Wikipedia entry:
A cumulative song is a song having a simple verse structure modified by progressive addition so that each verse is longer than the verse before.
An example of such a song that is probably familiar to you is The Twelve Days of Christmas.
For this assignment, you are to develop a Java application named RattlingBog that produces as output the lyrics —or most of them, anyway— of the cumulative Irish folk song The Rattlin' Bog. (The lyrics appear below.)
To give you a start, provided is a very poor solution in which the main() method simply prints every line of the song, one after the other.
Employing the technique of procedural decomposition, you should "refactor" the given program in order to improve its structure and to greatly reduce the amount of redundancy in its code. (For an analogy, recall from lecture how the DrawFigures1 program was transformed into DrawFigures2 and then DrawFigures3. Links to all three are on the course web page.) A goal to aim for is to make the program such that each distinct line of the song appears only once within it (as a literal String).
You will notice that the given program includes a method println() that acts as a "surrogate" for System.out.println(). The purpose of doing so is simply to de-clutter the program by making, for example, the statement println("cat") have the same effect as the more verbose System.out.println("cat"). If you would prefer to use the more verbose form, that is permissible.
The program that was provided to you (see link above) includes a comment describing the purpose/behavior of the program; a comment identifying the course, semester, and assignment number; and comments intended to identify the program's author (you!) and those who helped you to develop the program. Also included is a comment intended for you to describe any known defects of your program. Consider this to be a template that you are expected to follow in all subsequent assignments.
The song's lyrics are shown below in two columns; it is to be understood that the column on the left precedes the one to its right, consistent with the numbering of the verses.
|
|