Question
This is in java: Project Title: Album Collection Part 2 Goal: The goal of this assignment is to help students familiarize themselves with the following
This is in java:
Project Title: Album Collection Part 2
Goal: The goal of this assignment is to help students familiarize themselves with the following
Java programming concepts:
1. Serialization and data persistence.
2. Inheritance.
3. Sub-classing and abstract classes.
4. Interfaces.
5. Polymorphism.
Description:
For this assignment, you will refactor and add features to the Album Collection app that you
wrote in Assignment 1. ***Assignment 1 requirements:
Project Title: Album Catalog
Goal: The goal of this assignment is to help students familiarize themselves with the following
Java programming concepts:
1. Input/Output to and from the terminal.
2. Storing data in a file and reading data from a file.
3. Creating object-oriented classes and methods to handle data.
4. Using data structures to store data in main memory (e.g. ArrayList).
5. Working with character strings.
6. Using Javadoc comments and generating and html documentation of the program.
Description:
For this assignment you will create a program to manage an album collection. Your program will
allow the user to add new albums, display a list of all albums in the collection, search for a
specific album, delete a specific album. Your program should provide the user with a console or
command line choice menu about possible actions that they can perform. The choices should be
the following:
1. Display list of all albums in the collection.
2. Add a new album to the collection.
3. Search for an album given the name of the artist or title of the
album or part of the name of the artist or title of the album.
4. Delete an album from the collection.
5. Exit program.
To represent an item in your program, create a class named Album with the following fields:
title - string
artist - string
releaseYear - int
genre enum MusicGenre
The MusicGenre can be only one of the following: ROCK, RAP, COUNTRY,
POP.
When the program first loads, it reads all the saved albums (if any) from a file named
database.txt into an ArrayList. While the program is running, the user can choose any of
the 5 available options. When the user selects the option 5 (exit program), the program stores the
current contents of the ArrayList to the file (replacing the old contents) and exits. During the
program execution, if the user chooses to add or delete items, only the ArrayList will be updated.
The database.txt file will be updated automatically only when the program is about to exit.
In other words, when the user selects option 5, the program first saves all the contents of the
ArrayList into the text file, and then exits.
The format of the contents of the database.txt file should be in human readable plain text,
one record per line (note the ~ separator between different entries) For example:
Deftones~White Pony~2000~0
UGK~Ridin Dirty~1996~1
Josh Abbott Band~Scapegoat~2012~3
For display, albums should be printed to the console in the following format in alphabetical order
by album title. Override the toString() method to return this format.
Title: Ridin Dirty, Artist: UGK, Year: 1996, Genre: Rap
Title: Scapegoat, Artist: Josh Abbott Band, Year: 2012, Genre: Country
Title: White Pony, Artist: Deftones, Year: 2000, Genre: Rock***
Your app will support all of the features that were required in
Assignment 1 and a few new features. Your program should provide the user with a console or
command line choice menu about possible actions that they can perform. The choices should be
the following:
1. Display list of all albums in the collection.
2. Add a new album to the collection.
3. Search for an album given the name of the artist or title of the
album or part of the name of the artist or title of the album.
4. Delete an album from the collection.
5. Play an album.
1. Play.
2. Fast Forward.
3. Rewind.
4. Skip To Next Track (if album is a CD).
5. Skip To Previous Track (if album is a CD).
6. Exit Player.
6. Exit program.
New Features
Anytime a list of albums is displayed, the albums should be listed in alphabetical order by the
artists name. To sort the albums, you will write your own Comparable interface. Do NOT use
the Comparable interface that is build into the Java API.
Data will no longer be persisted using a .txt file. Data persistence will be accomplished using
serialization.
Option 5 (Play an album), will guide the user through the process of selecting an album to play.
Once an album is selected, the user will be presented with the play submenu that is shown above.
You will add features to your albums to support the play menu options 1 through 5.
You will also create two new classes of Albums: CompactDisc and CassetteTape.
A CompactDisc is an Album. A CassetteTape is an Album.
A CassetteTape will add the following fields:
lengthInSeconds double
currentPosition - double
A CompactDisc will add the following fields:
tracks ArrayList
currentTrackIndex int
A CompactDisc has Tracks. Hint: A Track is NOT an Album. A Track has the
following fields:
lengthInSeconds double
currentPosition double
All Albums and Tracks should support the following operations:
play()
fastForward()
rewind()
Hint: When a CompactDisc is being played, it is actually the currently selected Track that
is being played.
Obviously, your app will not have any real audio data to play or process. So, some of the
methods of this program will not be fully implemented. Some of the methods will merely be
stubs. For example:
public void skipToNext( ) {
// Skip to next track.
}
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