Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project, you will implement your own version of an ArrayList and use it to store Track objects that are songs played on an

In this project, you will implement your own version of an ArrayList and use it to store Track objects that are songs played on an MP3 player.

You will be provided with a fully functional MP3 player that uses the Java librarys ArrayList class. Your task is to get the MP3 player running exactly as given to you using your own implementation of an ArrayList.

The MP3Player.java file contains all code related to the GUI and playing of Mp3 files, as well as a main class that will test your data structure. You do not modify this file. In fact, you do not even need to understand all of the details of the Mp3Player.java file.

For your reference, I am using the javazoom mp3 decoder which is imported at the top of MP3Player.java in the following way: import javazoom.jl.player.advanced.*; // This is the MP3 decoder and player import java.io.FileInputStream; // This allows us to read files from disk

Setting up the jar files and the MP3s

The javazoom jar file and the MP3s are in zip file. You must extract this file to access the jar and MP3s. In File Explorer right click on the zip file and select Extract All. This will open the zip file and place all of the files in a new folder. You can now use those files in the instructions below.

Setting up the MP3 jar file

To run the player you must import the javazoom jar. For Eclipse, here are the instructions for adding the javazoom mp3 player to your classpath: Drag and drop the jar file into your /src folder of your project. Right-click the project and select Properties under the Java Build Path menu, select the Libraries button.

On the right-hand side, press the Add External JARs button and add the javazoom jar from your project source folder.

Placement of MP3s.

Place the MP3 files in the root project directory.

Placement of java files:

Place the java files in the src directory of the Java Project youve created for this project. Run MP3Player.java to run the music player.

Part 1 - MyArrayList.java (90 points)

Make sure to run the music player BEFORE you start writing code. This will give you a chance to test if the player works and to see the expected behavior.

Once the player is working as expected, you can start creating your own ArrayList for use in the MP3 player. Create a new Java File called, MyArrayList.java that implements the ListInterface interface provided to you. A description of what each method should do is found in the interface. The underlying encapsulated data structure in MyArrayList.java must be an array.

Once you have MyArrayList.java implemented, you can remove the ArrayList declaration and instantiation in Mp3Player.java and replace it with MyArrayList. Where this should be done is clearly marked in Mp3Player.java. You know you have most likely implemented the methods correctly if the program runs exactly the same with MyArrayList as it does with Javas ArrayList. We will run Mp3Player.java with your implementation as well as some additional tests to fully test the implementation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago