1. Problem: Create a Java application that enables a user to create a playlist f
ID: 3673689 • Letter: 1
Question
1. Problem: Create a Java application that enables a user to create a playlist from an online music library. To clarify the problem, I have divided it into 3 parts.
Part 1: Create Music Library. The program begins by creating an online music library from a list of music selections stored in a text file.
Part 2: Create/Delete/Modify Playlist. After creating the music library, the program welcomes the user, then provides him/her with a menu of options for creating or deleting a playlist, adding selections to or removing selections from the playlist, or quitting the application. Creating a playlist entails creating an empty playlist. Adding a selection to the playlist entails searching the music library first by artist then by title to locate the selection to add. Removing a selection from the playlist entails displaying the playlist selections, numbered, then prompting the user to enter the number of the selection to remove. Deleting a playlist entails simply deleting it (i.e., you do not have to empty it first). The playlist should be displayed after each addition or removal. As usual, all user input must be validated. The program continues to loop until the user decides to quit.
Part 3: Thank User. Finally, the program thanks the user for using the online music library.
Implementation Requirements and Guidelines:
• All music selections must be stored in and read from a text file. An example of recommended formatting for the text file appears at the end of this document.
• Java code that accesses the text file must be enclosed in a try-catch block. Minimally, your program must handle the FileNotFoundException.
• You must use a minimum of two classes to implement this program: a “driver” containing main and a MusicSelection class.
• The music library and the playlist must each be implemented as an ArrayList of MusicSelection objects.
• A MusicSelection object must have a minimum of 5 attributes: genre, artist, title, album, and release date.
• Required methods for the MusicSelection class include:
o A five-argument constructor that initializes the five instance variables (specified above).
o set and get methods for each of the five instance variables.
o A toString method to generate nicely formatted output.
• The music library must contain at least 20 music selections representing a variety of genres and artists.
• As usual, your program output should resemble the sample runs at the end of this document.
Explanation / Answer
public class change_file(filename, oldname, newname)
{
public class Delete_file(filename)
{
File f = filename;
f.delete();
system.out.println("file deleted");
system.out.println(" Enter the playlist to be read);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.