Starting from:

$30

CPT120-Tutorial 10 Solved

5.1  modify the object oriented (OO) version of the MusicLibrary so that it reads song data from a file.

You can create a plain text file named ‘songs.csv’ where each song’s data are stored in the following format on separate lines:

<song title,<song location

Where <song title is a particular Song object’s title and <song location is that same Song object’s location.

To achieve this, create a method named ‘loadSongs’ where you read songs.csv one line at a time and create new Song objects as you go. Think of an appropriate way to invoke/call this method and do so.

5.2  With the help of your group tutor, create a method named ‘saveSongs’ which will save all of the Song objects in the format given in

5.1 above, to the ‘songs.csv’ file. Find out if you would overwrite the file or if you would update the file.

5.3. (Optional) Do the same for Renovation Project Manager.

More products