Project 5 - A CD Database
Due - Thursday, May 17, 2007
Note: when you submit this project, submit all .java files in a directory named project5 in your submit directory. Double, triple, and quadruple check that the permissions on your files and directory are correct. Significant points will be deducted for any submission that I cannot readily access.
The goal of this project is to give you experience with Java
arrays. For this project, you will implement a CD Database. Your
program will support the following operations:
- Add a CD - A user must be able to add a new
CD by specifying the title and artist of the CD.
- Remove a CD - A user must be able to delete
a CD from the database.
- View all CDs - A user must be able to view all
CDs in her database alphabetically by artist name.
- View all CDs by a given artist - A user must be able to
view all CDs by a given artist by selecting this option and then
entering the name of the artist.
Your program should provide the user with a menu of the four
options described above and prompt for a selection. You must
ensure that all user input is valid. Once a selection is made,
perform the requested action and prompt for another selection.
Implementation Requirements and Hints
- At minimum, your program will implement a class
CD that contains data for a single CD
and a class Database that represents the list of all
the user's CDs.
- Each CD will minimally include (1) the title of the album and
(2)the name of the artist.
- The list of CDs will be kept in an array
sorted by the name of the artist. When a new
item is added, it will be inserted into the correct position in
the array. Note, you may not use an array list.
Extra Credit Opportunity
For extra credit, allow the user to view the CDs sorted by artist OR title.
Due 5:00PM, Thursday, May 17, 2007
- Complete and submit your working code. Turn in a hard copy in class and place a copy of all of your .java files in /home/submit/cs110-s07/username/project5.
- Make sure that each function is well documented. Your documentation should specify the type and function of the input parameters and output.
- Run your program on a variety of inputs ensuring that all error conditions are handled correctly.
Note: No portion of your code may be copied from any other
source including another text book, a web page, or another
student (current or former). You must provide citations for any
sources you have used in designing and implementing your program.
Sami Rollins