Sample song: After the Lights Go Out by the Walker Brothers
techred home > > multi-dimensional arrays

Multi-Dimensional Arrays


The goal of this program is to create a class which will receive, store, display and edit the lyrics of one or more songs of interest to the user.

wb_incandescentPhase 1 specs


Develop a class that uses two-dimensional arrays to store the lyrics of a given song in traditional lyric format of stanzas for each verse and chorus.

program requirement 1: lyric input

Your object class shall contain methods for reading in the lyrics of a given song, line by line, and stanza by stanza, as if the user is typing in the lyrics as the song plays.

program requirement 2: display of lyrics

Create an appropriately-named method on your object which a client class can call to display the lyrics in stanza format (i.e. like a poem)

program requirement 3: editing

Create one or more methods which allow the user to edit an individual line in the song and replace its contents with a new string. Create a simple user interface for allowing selection of the line of the lyric that requires replacing.

optional extension: timing

Use calls to Thread.sleep() to display the lyrics of the song in time with the actual music. Create an appropriate addition to your class's data structure to store the timing associated with each line of each stanza.

optional extension: chorus

Many songs have a repeated verse called a chorus. Make additions to your data structure and user interface to allow the user to designate a given stanza as the chorus, which can then be designated during input, avoiding the need to re-type the chorus.

program requirement 5: sharing

Post your code on your github account and make sure your git account is linked in our shared tracker