Question: Python Program Design a class named Song, which should have the following fields: title: The title field holds the name of a song. artist: The

Python Program

Design a class named Song, which should have the following fields:

  • title: The title field holds the name of a song.
  • artist: The artist field holds the artist of the song.
  • duration: The duration field holds the length of the song in seconds.

The Song class should also have the following methods:

  • setTitle: The setTitle method stores a value in the title field.
  • setArtist: The setArtist method stores a value in the artist field.
  • setDuration: The setDuration method stores a value in the duration field.
  • getTitle: The getTitle method returns the value of the title field.
  • getArtist: The getArtist method returns the value of the artist field.

getDuration: The getDuration method returns the value of the duration field

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!