Project: playlist manager | CSE2123 | Ohio State University

Overview

This project will allow you to write a program to get more practice with object-oriented ideas that we explored in the previous project, as well as some practice with more advanced ideas such as inheritance and the use of interfaces.

Ipods and other MP3 players organize a user’s music selection into groups known as playlists. These are data structures that provide a collection of songs and an ordering for how those songs will be played. For this assignment you will be writing a set of PlayList classes that could be used for a program that organizes music for a user. These classes will be written to implement a particular PlayList interface so that they can be easily exchange in and out as the program requires. In addition, you will also be using the SimpleTrack class you wrote for the closed lab on Interfaces – if you did not finish this class before the end of lab, you will need to finish it before starting on this project.

Objectives

  • Practice with programming fundamentals
    • Review of various Java fundamentals (branching, loops, variables, methods, etc.)
    • Review of Java File I/O concepts
    • Practice with Java ArrayList concepts
    • Practice with object-oriented programming and design
    • Practice with Java interfaces

Project Description

The SimplePlaylist Class

Once you have coded and tested your SimpleTrack class, you will need to write a SimplePlaylist class that implements the Playist interface given in the project folder.

The SimplePlayList class stores music tracks in order – the first track added to the play list should be the first one removed from the play list.  You should recognize this data structure as a queue (or a first-in, first-out queue).   You do not need to implement the equals, hashCode and toString methods for this class but if you choose to do so make sure you document your implementations properly!

 The PlayList Management Program

Once you have written and tested a SimpleTrack class and a SimplePlaylist class, it is time to use them to write a program to manage playlists.  This program will simulate the playing of songs from a play list.  For the SimplePlaylist, the songs are removed from the playlist as they are played, so you know that you’re at the end of the list when your list is empty.  This program should be implemented in the file MusicPlayerSimulator.java.  Note that we are not defining ANY of the methods you are using for this program – the design is all up to you.  You must, however, practice good programming style – make sure you are breaking the program up into smaller methods and aren’t just trying to solve everything with one monolithic main method.  If you have fewer than 5 methods for this program you are probably trying to fit too much into a single method.

Here is a sample transcript of the output of this program:

Enter database filename: input.txt Currently playing: 'Elvis Presley / Blue Suede Shoes / Elvis Presley: Legacy Edition' Next track to play: 'The Beatles / With A Little Help From My Friends / Sgt. Pepper's Lonely Hearts Club Band' [P]lay next track [A]dd a new track [Q]uit > p Currently playing: 'The Beatles / With A Little Help From My Friends / Sgt. Pepper's Lonely Hearts Club Band' Next track to play: 'The White Stripes / Seven Nation Army / Elephant' [P]lay next track [A]dd a new track [Q]uit > P Currently playing: 'The White Stripes / Seven Nation Army / Elephant' Next track to play: 'Cake / Long Line Of Cars / Comfort Eagle' [P]lay next track [A]dd a new track [Q]uit > a Track name: Requiem For A Dying Song Artist name: Flogging Molly Album name: Float Track: Requiem For A Dying Song Artist: Flogging Molly Album: Float Are you sure you want to add this track [y/n]? Currently playing: 'The White Stripes / Seven Nation Army / Elephant' Next track to play: 'Cake / Long Line Of Cars / Comfort Eagle' [P]lay next track [A]dd a new track [Q]uit > A Track name: Look What You Made Me Do Artist name: Taylor Swift Album name: Reputation Track: Look What You Made Me Do Artist: Taylor Swift Album: Reputation Are you sure you want to add this track [y/n]? Y Currently playing: 'The White Stripes / Seven Nation Army / Elephant' Next track to play: 'Cake / Long Line Of Cars / Comfort Eagle' [P]lay next track [A]dd a new track [Q]uit > q Tracks remaining in play list ------------------------------------------------------------ 1 - 'Cake / Long Line Of Cars / Comfort Eagle' 2 - 'Nine Inch Nails / Head Like A Hole / Pretty Hate Machine' 3 - 'Flogging Molly / Requiem For A Dying Song / Float' 4 - 'Taylor Swift / Look What You Made Me Do / Reputation'
  1. Ask the user to enter the name of the file that contains the play list data in the format described below.   
  2. Input the play list information from the file and store it in a SimplePlaylist object (using SimpleTrack objects).   See below for the format of this file.
  3. Indicate what song is currently playing and what song is next in the play list.  If there is no song currently playing (i.e. at the beginning right after the data file is loaded) the program should immediately advance to the next song in the list.  If the play list is empty and there is no next track, the program should indicate this with a message “Play list is empty – no more tracks”.
  4. Present the user a menu of three options – play the next song in the play list, add a new song to the play list, or quit.
  5. If the user chooses to play the next song, use the Playlist object to adjust the current track accordingly.  Make sure your code does the right thing and gives an error message if the play list is empty and the user tries to play the next song.
  6. If the user chooses to add a new track, prompt the user for the names of the song, artist and album.  Verify that the user actually wants to add the track and if they say “yes” to this prompt add the track to the play list appropriately.
  7. If the user chooses to quit, output a well-formatted report of the remaining songs in the play list, showing the name of the song, the artist and the album in the format indicated above.  If the play list is empty, indicate this with the message “No tracks remaining” where the report data would normally be.  When this report is finished the Playlist should be empty.

The file format that the play list manager program should read is a simple one.  An input file for multiple tracks would use this format:

track 1 name,artist 1 name,album 1 name
...
track n name,artist n name,album n name

The sample input file used in the transcript above looks like this and is included in the project folder in a file named input.txt:

Blue Suede Shoes,Elvis Presley,Elvis Presley: Legacy Edition
With A Little Help From My Friends,The Beatles,Sgt. Pepper's Lonely Hearts Club Band
Seven Nation Army,The White Stripes,Elephant
Long Line Of Cars,Cake,Comfort Eagle
Head Like A Hole,Nine Inch Nails,Pretty Hate Machine

Submission Instructions

Make sure your programs compile and run correctly before submitting.  To submit, make sure you include all of your files:  SimplePlaylist.java, SimpleTrack.java and MusicPlayerSimulator.java files with comments indicating who wrote them and the date (make sure you change the @author tag to your name and the @version tag to the date).  If you worked with a partner, there should be two @author tags.  Use the file upload button and navigate to the folder your workspace is in.  Then look for the CSE2123-Playlist folder – inside that folder is the src folder that has your files in it to upload.  You can also just drag-and-drop the files from your Eclipse workspace directly onto the file upload button.

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Custom Writings Help is a Quality-Oriented Company in Online Writing as a result of hiring exceptional professionals to execute clients' tasks.

Essays

Research Papers

At Custom Writings Help,We understand the struggle of research paper writing, and that is why at Custom WritingS Help, we are all out to help you. We pride ourselves on having a team of clinical writers. The stringent and rigorous vetting process ensures that only the 'BEST' Writers are chosen for the job. We have highly qualified Ph.D. and MA writers working with us; we equally offer these experienced writers specific bonuses and incentives to make them deliver highly original, unique, and informative content at reasonably low prices.

Admissions

Thesis Writing Service

Worlwide, Many Masters Students are struggling with Thesis Completion. A thesis is likely to be the longest and most challenging piece of work a student has ever completed. However, unlike essays and other assignments, a student can pick a particular interest topic and work on their initiative. Fortunately, we are there for you. At Custom Writings Help, you are assured of an authentic, imaginative, informative, linguistically great, and advantageous thesis that adheres to all your needs. So, why continue considering different writers when you have discovered the best in the field?

Editing

Custom Papers

Not a single student can avoid writing custom papers. However, a total lack of experience, skills, and time makes it very hard to produce a superb writing piece. Therefore, if you are seeking professional help, turn to us. Our specialized and experienced writers compose a variety of model papers, including custom essays, college term papers, research papers, book reports, MBA essays, executive summaries, dissertations, Ph.D. theses, admission essays, and research proposals for college and university students at any level.

Coursework

Essay Writing

Most of the students disregard the critical principles of essay writing and compose papers below sensible guidelines. Therefore, with Custom Writings Help, one should not worry about his/her essay. Our Writers compose informative and engaging content on all complexities and topics. We write meaningful and smart essays while prioritizing all aspects that bring about a good grade, such as impeccable grammar, proper structure, zero-plagiarism, and conformance to guidelines.

Coursework

Coourse Work Writing

Don't let the seemingly never-ending onslaught of writing assignments get you down. If you are looking where to get course work assistance online, the writers at Custom Writings Help are here to assist you with all of your writing needs. We undertake to unique delivery of papers that meet the professor's requirements. The content is proofread, edited, and checked plagiarism before submission to customers. No matter how big or small your work is, we will deliver on time. Try US Now! !

Coursework

Dissertation Writing Service

High-Quality Dissertation Writing Services are rare. They require Ph.D. academicians – not easily found. However, are an exception. The years, time, and resources we have invested in the dissertation world has given us a competitive advantage over others. Choose to come to Custom Writings Help; You will find perfect Ph.D. consultants who have written hundreds of dissertations theses ready to help you. Let our dissertation-writing services help you craft your dissertation, for you are assured we will give you the results.