| |
10. MusicStore: Adding Titles: Tasks | page 29 of 31 |
For this exercise you add the capability for managing multiple music titles, that is, storing, retrieving, and displaying titles. For more help with exercises, see About The Exercises PrerequisitesSkeleton Code
Tasks
-
Task 1
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.
-
Task 2
Add the instance variable titles of type MusicTitle[] to MusicStore, initialized to null, and then implement the access methods setTitles() and getTitles().
-
Task 3
Add a displayMusicTitles() method to MusicStore that traverses the array of titles and displays the title-artist data.
-
Task 4
Modify TestMusicStore to test/display the functionality of MusicStore's displayMusicTitles() method.
-
Task 5
Compile the source code for MusicStore and TestMusicStore.
-
Task 6
Execute TestMusicStore.
Help for each of these tasks can be found on the next page.
copyright 1996-2000 Magelang Institute dba jGuru
|