|
by 
[Help |
API Docs |
Short Course|
Exercises]
For this exercise you add the capability for managing multiple music titles, that is, storing,
retrieving, and displaying titles.
Prerequisites
Skeleton Code
Tasks
Create the user-defined data type MusicTitle with two String instance variables, title and artist, initialized to a "noname"-type of value to enhance debugging. Implement get and set access methods for both instance variables.
Add the instance variable titles of type MusicTitle[] to MusicStore, initialized to null, and then implement the access methods setTitles() and getTitles().
Add a displayMusicTitles() method to MusicStore that traverses the array of titles and displays the title-artist data.
Modify TestMusicStore to test/display the functionality of MusicStore's displayMusicTitles() method.
Compile the source code for MusicStore and TestMusicStore.
Execute TestMusicStore.
Where help exists, the task numbers above are linked to the step-by-step help page.
Solution Source
Demonstration
The output should be similar to the following, either on the command line or in an IDE window:
Title 1:
Title: Las Cosas Que Vives
Artist: Laura Pausini
Title 2:
Title: Luna Nueva
Artist: Diego Torres
|
Copyright 1996-2000 jGuru.com. All Rights Reserved.
|
|