Question
Write a Java class called Song to represent a song in a music collection. The data members of the Song class are String objects representing
Write a Java class called Song to represent a song in a music collection. The data members of the Song class are String objects representing the song title, artists name, and the album where the song can be found. These instance variables for the class are to have private access modifiers so you will need to write the appropriate methods to allow a client to access and modify the data values. In accordance with good programming practice, you are to override the equals and toString methods inherited from Object. In addition, this class is going to be used in a Collection that is to be sorted, so it is to implement the Comparable interface.
A second class is to be written called SongList that contains a main method that reads in a file name via the command line. The file is a listing of the songs on one of my playlists. In the file each song is on a single line. The line is formatted with the song name, the artist name and the album each separated by a colon (:) and varying amounts of white space. Each playlist contains no more that 75 songs.
The program is to:
prompt the user to enter the name of an artist
provide a formatted list of all the songs by that artist that appear on the playlist, grouped by album and in alphabetical order by song title.
If no songs by the given artist are on the playlist, an appropriate message is to be displayed.
It is expected that your program will be well documented and you are required to write a private helper method called printHeading that outputs the following information to the console in an easy-to-read format: your name, the project number, the course identifier (CMSC 202), and the current semester. You will call this method as the first statement in your main method. All files must contain a comment block at the beginning that includes the file name; all of the same information that was specified for the helper method printHeading; and a brief description of the files purpose.
You will submit the project files (Song.java and SongList.java). Do not compress the files, they should both be submitted as a single submission of two individual files.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started