Question: A music program uses the Song and Playlist class to keep track of songs and playlists of songs. (a) The Song class keeps track of


A music program uses the Song and Playlist class to keep track of songs and playlists of songs. (a) The Song class keeps track of a song's a title (a string) and a song's length (an integer) in seconds. Write the Song class by writing the appropriate constructor and "getter" methods. Appropriately indicate to users of the Song class that the title and length attributes should not be directly accessed-users of the Song class should use the getter methods to retrieve title and length information. Example Song construction and usage: song1 Song("Happy", 240) assert(song1.get_title)"Happy" assert song2.get length)240) class Song
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
