Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Music Playlist

angelingdogdog
angelingdogdog 


Due Date: Friday, March 4th, 2016 (5:00 p.m.) Instructions: Please create a Java application to solve the following problem. Submit electronic copies of your program source code, text file, and two or more sample runs to me by the deadline. Also submit printouts of your source code, text file, and runs by the deadline. Documentation requirements follow the problem specification. 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. 2 References: • Savitch: Chapters 1 – 5 (basics, classes); 10 (file I/O); 14 (class ArrayList) Documentation Requirements: 1) Each program source code file (i.e., Java class) must have a header at the beginning of the class containing the following: • Name of author, PSU e-mail address of author, name of course, assignment number and due date, name of file, purpose of class, compiler/IDE, operating system, and any external references used (e.g., Website) 2) The purpose of each method in the source code file(s) must be documented as shown in the example below. I prefer that you use the javadoc comment style. /** This method adds a music selection to the playlist. * * @param playlistItem The selection to add to the playList */ public void addToPlaylist(MusicSelection playlistItem) { // Method definition (i.e., body) } Attachments Tags
Clarifications

Answers